protected virtual void Flush_Should_Succeed() { for (var i = 0; i < 5; i++) { _provider.Set($"flush:{i}", $"value{i}", _defaultTs); } for (var i = 0; i < 5; i++) { Assert.Equal($"value{i}", _provider.Get <string>($"flush:{i}").Value); } _provider.Flush(); for (var i = 0; i < 5; i++) { Assert.False(_provider.Get <string>($"flush:{i}").HasValue); } }
/// <summary> /// Flush this instance. /// </summary> public void Flush() { _localCachingProvider.Flush(); try { _distributedCachingProvider.Flush(); } catch (Exception ex) { System.Console.WriteLine(ex.Message); } }
/// <summary> /// 清空缓存 /// </summary> public void Clear() { _provider.Flush(); }
/// <summary> /// 清空缓存 /// </summary> public void Clear() => _provider.Flush();
/// <summary> /// Removes the cached entries added by this library. /// </summary> public void ClearAllCachedEntries() { _readerWriterLockProvider.TryWriteLocked(() => _easyCachingProvider.Flush()); }
/// <summary> /// Flush All Cached Item /// </summary> public void Flush() { _easyCachingProvider.Flush(); }
internal void Server_Started(object sender, EventArgs e) { _device.Flush(); _logger.LogInformation($"MqttServer is started"); uptime = DateTime.Now; }