[server] [ scheduler.script ] - 优化定时脚本任务部分的代码 - 1

This commit is contained in:
zeaslity
2023-02-16 14:34:51 +08:00
parent 2f8f586b0e
commit 2f2b9da5b7
3 changed files with 7 additions and 7 deletions

View File

@@ -70,7 +70,7 @@ public class CommandResultReader implements StreamListener<String, MapRecord<Str
log.info("Octopus Agent [ {} ] execution of [ {} ] Time is [ {} ] stream recordId is [{}]", log.info("Octopus Agent [ {} ] execution of [ {} ] Time is [ {} ] stream recordId is [{}]",
streamKey, streamKey,
key, executionResultFormat.get(1),
key, key,
messageId); messageId);
// print to console // print to console

View File

@@ -26,11 +26,6 @@ public class AgentScriptSchedulerJob extends QuartzJobBean {
@Override @Override
protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException { protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
log.info("[ 定时脚本任务 ]被调用了,调用时间为: {}",
TimeUtils.currentTimeString()
);
// 解析 Scheduler 模块传递过来的参数 // 解析 Scheduler 模块传递过来的参数
JobDataMap jobDataMap = jobExecutionContext JobDataMap jobDataMap = jobExecutionContext
.getJobDetail() .getJobDetail()
@@ -39,6 +34,11 @@ public class AgentScriptSchedulerJob extends QuartzJobBean {
// ScriptScheduleDTO // ScriptScheduleDTO
ScriptSchedulerDTO scriptSchedulerDTO = (ScriptSchedulerDTO) jobDataMap.get(SCRIPT_SCHEDULER_MISSION_KEY); ScriptSchedulerDTO scriptSchedulerDTO = (ScriptSchedulerDTO) jobDataMap.get(SCRIPT_SCHEDULER_MISSION_KEY);
log.info("[ 定时脚本任务 ] - 调用时间为: {}; 执行内容为: {}",
TimeUtils.currentTimeString(),
scriptSchedulerDTO
);
// 调用实际任务执行器, 实际执行定时任务的核心业务内容 // 调用实际任务执行器, 实际执行定时任务的核心业务内容
agentApplyScheduledScript.apply(scriptSchedulerDTO); agentApplyScheduledScript.apply(scriptSchedulerDTO);