From 8f392cc88b0768b74efca3b68785cf5aa1c38e70 Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期三, 06 十一月 2024 14:28:20 +0800 Subject: [PATCH] 代码更新 --- wcs-server-hbf/WIDESEA_WCS/Jobs/RGV/AgvAndEquiWorkFJJob.cs | 21 +++++++++++++++------ 1 files changed, 15 insertions(+), 6 deletions(-) diff --git a/wcs-server-hbf/WIDESEA_WCS/Jobs/RGV/AgvAndEquiWorkFJJob.cs b/wcs-server-hbf/WIDESEA_WCS/Jobs/RGV/AgvAndEquiWorkFJJob.cs index 7a56743..8b541d6 100644 --- a/wcs-server-hbf/WIDESEA_WCS/Jobs/RGV/AgvAndEquiWorkFJJob.cs +++ b/wcs-server-hbf/WIDESEA_WCS/Jobs/RGV/AgvAndEquiWorkFJJob.cs @@ -1,5 +1,6 @@ 锘縰sing Quartz; using System; +using System.Threading; using System.Threading.Tasks; using WIDESEA_WCS.Jobs; using WIDESEA_WCS.SchedulerExecute.AGV; @@ -12,11 +13,12 @@ /// </summary> public class AgvAndEquiWorkFJJob : JobBase, IJob { + private static int lockObj1 = 0; public Task Execute(IJobExecutionContext context) { try { - + var executeLog = ExecuteJob(context, () => Run(context)); } catch (Exception) @@ -27,14 +29,21 @@ } public string Run(IJobExecutionContext context) { - try + if (lockObj1 == 0) { - AGVSchedulerExecute.AgvAndEquiWorkFJ();//璐熸瀬璁惧涓嶢GV浜や簰 - + try + { + lockObj1 = 1; + AGVSchedulerExecute.AgvAndEquiWorkFJ();//璐熸瀬璁惧涓嶢GV浜や簰 + } + catch (Exception ex) + { + lockObj1 = 0; + throw new Exception(ex.Message); + } } - catch (Exception) { } - return ""; + return string.Empty; } } } -- Gitblit v1.9.3