/// <summary> /// 刷新蓄电池极速达服务缓存 /// </summary> /// <param name="regionId"></param> /// <param name="productPids"></param> /// <returns></returns> private bool RefreshFastDeliveryServiceCache(int regionId, List <string> productPids) { var result = true; try { if (productPids.Any()) { var cacheKeys = new List <string>(); var batteryFastDeliveryServiceCacheKey = "BatteryFastDeliveryService/{0}/{1}"; productPids.ForEach(s => cacheKeys.Add(string.Format(batteryFastDeliveryServiceCacheKey, regionId, s))); using (var client = new Tuhu.Service.BaoYang.CacheClient()) { var cacheResult = client.Remove(cacheKeys); cacheResult.ThrowIfException(true); result = cacheResult.Result; } } } catch (Exception ex) { result = false; Logger.Error("RefreshFastDeliveryServiceCache", ex); } return(result); }
public bool RefreshBatteryFastDeliveryPrioritiesCache(int provinceId, int cityId) { var result = false; try { const string keyPrefix = "PrioritySetting/BatteryFastDelivery/{0}/{1}"; var key = string.Format(keyPrefix, provinceId, cityId); using (var client = new Tuhu.Service.BaoYang.CacheClient()) { var cacheResult = client.Remove(new[] { key }); cacheResult.ThrowIfException(true); result = cacheResult.Result; } } catch (Exception ex) { Logger.Error("RefreshBatteryFastDeliveryPrioritiesCache", ex); } return(result); }