| | |
| | | @Autowired |
| | | ScheduleService scheduleService; |
| | | |
| | | private static boolean isBusy = false; |
| | | |
| | | private static final Log log = LogFactory.getLog(ScheduleConfig.class); |
| | | |
| | | @Scheduled(fixedRate = 15 * 1000) |
| | |
| | | jsonObject.put("operateCount", scheduleService.operateCount()); |
| | | |
| | | // 资源调用状态 |
| | | |
| | | String json = JSONObject.toJSONStringWithDateFormat(jsonObject, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteMapNullValue); |
| | | |
| | | WebSocketService.broadCastInfo(json); |
| | |
| | | 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); |
| | | } |
| | | } |