From 71403dd5e730c6966b2754f94b8a2df50729bfd3 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期五, 27 三月 2026 14:10:04 +0800
Subject: [PATCH] fix(RouterService): AddRouters 缓存更新用 try-catch 保护
---
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs
index 8ebe3d7..e0259be 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs
@@ -608,7 +608,15 @@
// 閲嶆柊鏌ヨ鍏ㄩ噺璺敱锛堟鏃舵墠鍖呭惈鏂板鐨勮矾鐢憋級锛屽啀鍐欏叆缂撳瓨
List<Dt_Router> updatedRouters = BaseDal.QueryData(x => x.InOutType == routerType);
string cacheKey = $"Router:AllRouters:{(routerType == RouterInOutType.In.ObjToInt() ? "In" : "Out")}";
- _cacheService.AddOrUpdate(cacheKey, updatedRouters);
+
+ try
+ {
+ _cacheService.AddOrUpdate(cacheKey, updatedRouters);
+ }
+ catch
+ {
+ // 缂撳瓨鏇存柊澶辫触鏃堕潤榛樺拷鐣ワ紝涓嬫鏌ヨ浼氫粠DB鑷姩閲嶅缓缂撳瓨
+ }
content = WebResponseContent.Instance.OK();
}
--
Gitblit v1.9.3