| | |
| | | @Value("${csv.cron_max}") |
| | | private int cronMax = 48; |
| | | |
| | | private static boolean isBusy = false; |
| | | |
| | | private final static List<String> md5List = new ArrayList<>(); |
| | | |
| | | private final static SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHH"); |
| | |
| | | |
| | | @Scheduled(cron = "${csv.cron}") |
| | | private void loadCsvSync() { |
| | | if (isBusy) return; |
| | | |
| | | isBusy = true; |
| | | logger.info("***************** 开始执行CSV入库 *****************" + "\n"); |
| | | Calendar calendar = getCalendar(1); |
| | | for (int i = 0; i < cronMax; i++) { |
| | |
| | | } |
| | | } |
| | | logger.info("***************** CSV入库执行完成 *****************" + "\n"); |
| | | isBusy = false; |
| | | } |
| | | |
| | | public Calendar getCalendar(int start) { |