Exemple #1
0
        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);
            }
        }
Exemple #2
0
        /// <summary>
        /// Flush this instance.
        /// </summary>
        public void Flush()
        {
            _localCachingProvider.Flush();

            try
            {
                _distributedCachingProvider.Flush();
            }
            catch (Exception ex)
            {
                System.Console.WriteLine(ex.Message);
            }
        }
Exemple #3
0
 /// <summary>
 /// 清空缓存
 /// </summary>
 public void Clear()
 {
     _provider.Flush();
 }
 /// <summary>
 /// 清空缓存
 /// </summary>
 public void Clear() => _provider.Flush();
Exemple #5
0
 /// <summary>
 /// Removes the cached entries added by this library.
 /// </summary>
 public void ClearAllCachedEntries()
 {
     _readerWriterLockProvider.TryWriteLocked(() => _easyCachingProvider.Flush());
 }
Exemple #6
0
 /// <summary>
 /// Flush All Cached Item
 /// </summary>
 public void Flush()
 {
     _easyCachingProvider.Flush();
 }
Exemple #7
0
 internal void Server_Started(object sender, EventArgs e)
 {
     _device.Flush();
     _logger.LogInformation($"MqttServer is  started");
     uptime = DateTime.Now;
 }