Exemplo n.º 1
0
        /// <summary>
        /// CacheQueue的清理方法
        /// </summary>
        private static void ScavengeCache()
        {
            while (true)
            {
                //清理周期,在配置文件中进行设置
                Thread.Sleep(CacheSettingsSection.GetConfig().ScanvageInterval);

                InternalScavenge();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取Cache的配置信息
        /// </summary>
        /// <returns>Cache的配置信息</returns>
        public static CacheSettingsSection GetConfig()
        {
            CacheSettingsSection result = (CacheSettingsSection)ConfigurationBroker.GetSection("cacheSettings");

            if (result == null)
            {
                result = new CacheSettingsSection();
            }

            return(result);
        }