|
@@ -16,11 +16,26 @@ import org.springframework.stereotype.Component;
|
|
|
public class PushRecordsTask {
|
|
|
@Value("${originalRecords.path}")
|
|
|
private String originalRecordsPath;
|
|
|
+ @Value("${errorRecords.path}")
|
|
|
+ private String errorRecordsPath;
|
|
|
+
|
|
|
@Autowired
|
|
|
TrafficRecordsAnalyseService trafficRecordsAnalyseService;
|
|
|
|
|
|
@Scheduled(cron = "0 0 0/1 * * ?")
|
|
|
+// @Scheduled(cron = "0 0/2 * * * ?")
|
|
|
public void push() {
|
|
|
trafficRecordsAnalyseService.pushTrafficRecords(originalRecordsPath);
|
|
|
}
|
|
|
+
|
|
|
+ @Scheduled(cron = "0 0 0/1 * * ?")
|
|
|
+// @Scheduled(cron = "0 0/2 * * * ?")
|
|
|
+ public void pushErrorRecords() {
|
|
|
+ log.info("pushErrorRecordsScheduledBegin");
|
|
|
+ long startTime = System.currentTimeMillis();
|
|
|
+ trafficRecordsAnalyseService.pushErrorRecords(errorRecordsPath);
|
|
|
+ log.info("pushErrorRecordsScheduledEnd:{}", (System.currentTimeMillis() - startTime));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|