Beispiel #1
0
        public static void Clear(bool sync = true)
        {
            CacheProvider.Provider.Clear();

            if (sync)
            {
                var msg = CacheSyncMsg.CreateClearMsg(_sender);
                _subscriber.Publish(_channel, DynamicJson.Serialize(msg));
            }
        }
Beispiel #2
0
        public void Clear()
        {
            if (_storage.Count > 0)
            {
                _keys.Clear();
                _storage = new MemoryCache(new MemoryCacheOptions());
                GC.Collect();

                var msg = CacheSyncMsg.CreateClearMsg(_self);
                _subscriber.Publish(_channel, DynamicJson.Serialize(msg));
            }
        }