管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-07-14 ac20dc99bf1f463365dba071973e08fffbd294b4
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);
        }
    }