|
@@ -47,8 +47,8 @@ public class ParseSchedulerTask {
|
|
|
*/
|
|
|
@Scheduled(cron = "0 */11 * * * ?")
|
|
|
public void letter() {
|
|
|
- String taskKye = "mo_email_parse_letter_task";
|
|
|
- TaskRecordDO task = this.taskRecordService.getTaskRecord(taskKye);
|
|
|
+ String taskKey = "mo_email_parse_letter_task";
|
|
|
+ TaskRecordDO task = this.taskRecordService.getTaskRecord(taskKey, 11 * 2 * 60);
|
|
|
if (task == null) {
|
|
|
return;
|
|
|
}
|
|
@@ -64,12 +64,12 @@ public class ParseSchedulerTask {
|
|
|
} catch (Exception e) {
|
|
|
task.setStatus(2);
|
|
|
task.setErrMsg(ExceptionUtil.stacktraceToString(e));
|
|
|
- this.logger.error("任务{} 执行错误:{}", taskKye, ExceptionUtil.stacktraceToString(e));
|
|
|
+ this.logger.error("任务{} 执行错误:{}", taskKey, ExceptionUtil.stacktraceToString(e));
|
|
|
} finally {
|
|
|
task.setEndTime(now);
|
|
|
this.taskRecordService.updateStatus(task);
|
|
|
if (this.logger.isInfoEnabled()) {
|
|
|
- this.logger.info("任务{} 执行完成,耗时:{}ms", taskKye, System.currentTimeMillis() - start);
|
|
|
+ this.logger.info("任务{} 执行完成,耗时:{}ms", taskKey, System.currentTimeMillis() - start);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -79,8 +79,8 @@ public class ParseSchedulerTask {
|
|
|
*/
|
|
|
@Scheduled(cron = "0 */21 * * * ?")
|
|
|
public void report() {
|
|
|
- String taskKye = "mo_email_parser_report_task";
|
|
|
- TaskRecordDO task = this.taskRecordService.getTaskRecord(taskKye);
|
|
|
+ String taskKey = "mo_email_parser_report_task";
|
|
|
+ TaskRecordDO task = this.taskRecordService.getTaskRecord(taskKey, 21 * 2 * 60);
|
|
|
if (task == null) {
|
|
|
return;
|
|
|
}
|
|
@@ -96,12 +96,12 @@ public class ParseSchedulerTask {
|
|
|
} catch (Exception e) {
|
|
|
task.setStatus(2);
|
|
|
task.setErrMsg(ExceptionUtil.stacktraceToString(e));
|
|
|
- this.logger.error("定期报告解析任务{} 执行错误:{}", taskKye, ExceptionUtil.stacktraceToString(e));
|
|
|
+ this.logger.error("定期报告解析任务{} 执行错误:{}", taskKey, ExceptionUtil.stacktraceToString(e));
|
|
|
} finally {
|
|
|
task.setEndTime(now);
|
|
|
this.taskRecordService.updateStatus(task);
|
|
|
if (this.logger.isInfoEnabled()) {
|
|
|
- this.logger.info("定期报告解析任务{} 执行完成,耗时:{}ms", taskKye, System.currentTimeMillis() - start);
|
|
|
+ this.logger.info("定期报告解析任务{} 执行完成,耗时:{}ms", taskKey, System.currentTimeMillis() - start);
|
|
|
}
|
|
|
}
|
|
|
}
|