Beispiel #1
0
        /// <summary>
        /// 根据主键获取配置信息
        /// </summary>
        /// <param name="StrKey"></param>
        /// <returns></returns>
        public static SettingInfo GetSettingByKeyStr(string StrKey)
        {
            SettingCacheGetByKeyRequest settingCacheGetByKeyRequest = new SettingCacheGetByKeyRequest();

            settingCacheGetByKeyRequest.StrKey = StrKey;
            var result = settingCacheService.GetSettingCacheByKey(settingCacheGetByKeyRequest);

            if (result.Data != null && result.IsSuccess)
            {
                return(result.Data);
            }

            return(null);
        }
Beispiel #2
0
        public BasicResponse <SettingInfo> GetSettingCacheByKey(GetSettingCacheByKeyRequest request)
        {
            var req = new SettingCacheGetByKeyRequest
            {
                StrKey = request.Key
            };
            var res = _SettingCacheService.GetSettingCacheByKey(req);
            var ret = new BasicResponse <SettingInfo>
            {
                Data = res.Data
            };

            return(ret);
        }
Beispiel #3
0
        public R_PBCacheService(ISettingCacheService _settingCacheService)
        {
            int R_PBCacheClearTime = 5;

            settingCacheService = _settingCacheService;
            //读取报警缓存清除时间的配置  20170723
            SettingCacheGetByKeyRequest request = new SettingCacheGetByKeyRequest();

            request.StrKey = "R_PBCacheClearTime";
            var result = settingCacheService.GetSettingCacheByKey(request);

            if (result != null && result.Data != null)
            {
                int.TryParse(result.Data.StrValue, out R_PBCacheClearTime);
            }
            if (R_PBCacheClearTime < 5)
            {
                R_PBCacheClearTime = 5;//最少5分钟
            }
            delaytime = new TimeSpan(0, R_PBCacheClearTime, 0);
            cleanR_PBCacheThreadRunning = false;
        }