[ Agent ] [ Executor ] 优化Excuetor部分的代码

This commit is contained in:
zeaslity
2023-08-14 10:43:22 +08:00
parent 92390b4d6f
commit 7ca5e232bf
4 changed files with 31 additions and 26 deletions

View File

@@ -1,8 +1,7 @@
package io.wdd.rpc.scheduler.service.script;
import io.wdd.rpc.execute.ExecutionMessage;
import io.wdd.rpc.message.OctopusMessage;
import io.wdd.rpc.execute.service.ExecutionService;
import io.wdd.rpc.scheduler.beans.ScriptSchedulerDTO;
import io.wdd.rpc.scheduler.config.QuartzSchedulerUtils;
import lombok.extern.slf4j.Slf4j;
@@ -22,7 +21,7 @@ import java.util.stream.Collectors;
public class AgentApplyScheduledScript {
@Resource
AsyncExecutionService asyncExecutionService;
ExecutionService executionService;
@Resource
QuartzSchedulerUtils quartzSchedulerUtils;
@@ -52,27 +51,25 @@ public class AgentApplyScheduledScript {
.stream()
.map(
targetMachine -> {
OctopusMessage octopusMessage = asyncExecutionService
.AsyncCallSendCommandToAgent(
targetMachine,
finalScriptType,
null,
null,
completeCommandList,
false,
null,
false
);
// OctopusMessage octopusMessage = executionService
// .SendCommandToAgent(
// targetMachine,
// finalScriptType,
// null,
// null,
// completeCommandList,
// false,
// false
// );
String resultKey = ((ExecutionMessage) octopusMessage.getContent()).getResultKey();
// 构建Map
futureResultKeyMap.put(
targetMachine,
resultKey
"todo 2023年8月14日"
);
return resultKey;
return "todo 2023年8月14日";
}
)
.collect(Collectors.toList());