示例#1
0
 private static void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
 {
     if (!applyMemCached)
     {
         //检查并移除相应的缓存项
         instance = CachesFileMonitor.CheckAndRemoveCache(instance);
     }
 }
示例#2
0
        /// <summary>
        /// 单体模式返回当前类的实例
        /// </summary>
        /// <returns></returns>
        public static ShopCache GetCacheService()
        {
            if (instance == null)
            {
                lock (lockHelper)
                {
                    if (instance == null)
                    {
                        instance = applyMemCached ? new ShopCache() : CachesFileMonitor.CheckAndRemoveCache(new ShopCache());
                    }
                }
            }

            return(instance);
        }