Exemple #1
0
        /// <summary>
        /// 刷新客户专享活动配置缓存
        /// </summary>
        /// <param name="activityExclusiveId"></param>
        /// <returns></returns>
        public static async Task <bool> RefreshRedisCacheCustomerSetting(string activityExclusiveId)
        {
            using (var client = CacheHelper.CreateCacheClient(ActivityManager.DefaultClientName))
            {
                var data = await DalActivity.SelectCustomerExclusiveSettingInfo(activityExclusiveId, false);

                var result = await client.SetAsync(string.Concat("CustomerSettingInfo/", activityExclusiveId), data
                                                   , TimeSpan.FromDays(2));

                if (result.Success)
                {
                    return(true);
                }
                else
                {
                    Logger.Warn($"set redis缓存失败,接口==》RefreshRedisCacheCustomerSettingAsync");
                    return(false);
                }
            }
        }