From ec7fa1df7b083e7b03ccb8c2dae9a03598f3c00f Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期四, 24 八月 2023 11:18:52 +0800
Subject: [PATCH] 修改MD架构的实体类

---
 src/main/java/com/lf/server/config/ScheduleConfig.java |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/lf/server/config/ScheduleConfig.java b/src/main/java/com/lf/server/config/ScheduleConfig.java
index b1d6801..1fbe663 100644
--- a/src/main/java/com/lf/server/config/ScheduleConfig.java
+++ b/src/main/java/com/lf/server/config/ScheduleConfig.java
@@ -28,6 +28,8 @@
     @Autowired
     ScheduleService scheduleService;
 
+    private static boolean isBusy = false;
+
     private static final Log log = LogFactory.getLog(ScheduleConfig.class);
 
     @Scheduled(fixedRate = 15 * 1000)
@@ -82,7 +84,6 @@
             jsonObject.put("operateCount", scheduleService.operateCount());
 
             // 璧勬簮璋冪敤鐘舵��
-
             String json = JSONObject.toJSONStringWithDateFormat(jsonObject, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteMapNullValue);
 
             WebSocketService.broadCastInfo(json);
@@ -98,15 +99,18 @@
     public void syncAttaches() {
         try {
             List<FmeLogEntity> list = attachService.selectFmeLogs();
-            if (null == list || list.isEmpty()) {
+            if (isBusy || null == list || list.isEmpty()) {
                 return;
             }
 
+            isBusy = true;
             for (FmeLogEntity entity : list) {
                 attachService.syncAttaches(entity);
                 attachService.updateFmeLog(entity.getId());
             }
+            isBusy = false;
         } catch (Exception ex) {
+            isBusy = false;
             log.error(ex.getMessage(), ex);
         }
     }

--
Gitblit v1.9.3