管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-03-26 db5338c2246acbc0826a9b683392512cf00eba04
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)
@@ -98,15 +100,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.updateFmeLog(entity.getId());
                attachService.syncAttaches(entity);
                attachService.updateFmeLog(entity.getId());
            }
            isBusy = false;
        } catch (Exception ex) {
            isBusy = false;
            log.error(ex.getMessage(), ex);
        }
    }