public async Task <ActionResult> Edit(BeautyHomePageConfig model) { try { if (model.Id != 0) { if (BeautyHomePageConfigManager.UpdateBeautyHomePageConfig(model)) { CleanCahce(model.Channel, model.Type); } var beautyServiceProxy = new BeautyServiceProxy(); await beautyServiceProxy.RefreshModuleCacheAsync(model.Id); await beautyServiceProxy.RemoveCacheKeyAsync($"BeautyCategoriesPrefixV2-{model.Id}"); } else { int outId = 0; if (BeautyHomePageConfigManager.InsertBeautyHomePageConfig(model, ref outId)) { CleanCahce(model.Channel, model.Type); } } return(Json(true)); } catch (Exception ex) { return(Json(false)); throw ex; } }
private async Task <bool> UpdateBeautyBannerCache(string channel) { var result = false; using (var client = new GroupBuyingClient()) { var temp = client.RefreshBeautyBannerCache(channel); temp.ThrowIfException(true); result = temp.Result; } var beautyServiceProxy = new BeautyServiceProxy(); await beautyServiceProxy.RefreshBeautyBannerCacheAsync(channel); return(result); }