| | |
| | | @Autowired |
| | | ScheduleService scheduleService; |
| | | |
| | | private static boolean isBusy = false; |
| | | |
| | | private static final Log log = LogFactory.getLog(ScheduleConfig.class); |
| | | |
| | | @Scheduled(fixedRate = 15 * 1000) |
| | |
| | | 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); |
| | | } |
| | | } |