[AGENT][Executor] 修复机器重启的Bug

This commit is contained in:
zeaslity
2023-03-02 14:08:01 +08:00
parent c3b2ce84a3
commit 8ca593862e
6 changed files with 64 additions and 38 deletions

View File

@@ -40,7 +40,8 @@ public class ExecutionController {
@RequestParam(value = "commandList", required = false) @Nullable List<String> commandList,
@RequestParam(value = "completeCommandList", required = false)
@ApiParam(name = "completeCommandList", value = "完整命令行,优先,可为空") @Nullable List<List<String>> completeCommandList,
@RequestParam(value = "type", required = false) @Nullable String type
@RequestParam(value = "type", required = false) @Nullable String type,
@ApiParam(name = "isDurationTask", value = "是否是持久化任务") @RequestParam(value = "isDurationTask", defaultValue = "false", required = false) boolean isDurationTask
) {
String streamKey = asyncExecutionService
@@ -51,7 +52,7 @@ public class ExecutionController {
completeCommandList,
false,
null,
false
isDurationTask
);
return R.ok(streamKey);
@@ -66,14 +67,16 @@ public class ExecutionController {
@ApiParam(name = "commandList", value = "命令行") @Nullable List<String> commandList,
@RequestParam(value = "completeCommandList", required = false)
@ApiParam(name = "completeCommandList", value = "完整命令行,优先,可为空") @Nullable List<List<String>> completeCommandList,
@RequestParam(value = "type", required = false) @Nullable String type
@RequestParam(value = "type", required = false) @Nullable String type,
@ApiParam(name = "isDurationTask", value = "是否是持久化任务") @RequestParam(value = "isDurationTask", defaultValue = "false", required = false) boolean isDurationTask
) {
return R.ok(asyncExecutionService.SendCommandToAgentComplete(
topicNameList,
type,
commandList,
completeCommandList
completeCommandList,
isDurationTask
));
}
@@ -85,14 +88,16 @@ public class ExecutionController {
@ApiParam(name = "commandList", value = "命令行") @Nullable List<String> commandList,
@RequestParam(value = "completeCommandList", required = false)
@ApiParam(name = "completeCommandList", value = "完整命令行,优先,可为空") @Nullable List<List<String>> completeCommandList,
@RequestParam(value = "type", required = false) @Nullable String type
@RequestParam(value = "type", required = false) @Nullable String type,
@ApiParam(name = "isDurationTask", value = "是否是持久化任务") @RequestParam(value = "isDurationTask", defaultValue = "false", required = false) boolean isDurationTask
) {
return R.ok(asyncExecutionService.SendCommandToAgentComplete(
ALL_AGENT_TOPIC_NAME_LIST,
type,
commandList,
completeCommandList
completeCommandList,
isDurationTask
));
}
@@ -103,14 +108,16 @@ public class ExecutionController {
@ApiParam(name = "commandList", value = "命令行") @Nullable List<String> commandList,
@RequestParam(value = "completeCommandList", required = false)
@ApiParam(name = "completeCommandList", value = "完整命令行,优先,可为空") @Nullable List<List<String>> completeCommandList,
@RequestParam(value = "type", required = false) @Nullable String type
@RequestParam(value = "type", required = false) @Nullable String type,
@ApiParam(name = "isDurationTask", value = "是否是持久化任务") @RequestParam(value = "isDurationTask", defaultValue = "false", required = false) boolean isDurationTask
) {
return R.ok(asyncExecutionService.SendCommandToAgentComplete(
ALL_HEALTHY_AGENT_TOPIC_NAME_LIST,
type,
commandList,
completeCommandList
completeCommandList,
isDurationTask
));
}
@@ -144,7 +151,8 @@ public class ExecutionController {
@ApiParam(name = "commandList", value = "命令行") @Nullable List<String> commandList,
@RequestParam(value = "completeCommandList", required = false)
@ApiParam(name = "completeCommandList", value = "完整命令行,优先,可为空") @Nullable List<List<String>> completeCommandList,
@RequestParam(value = "type", required = false) @ApiParam(name = "type", value = "执行命令类型") @Nullable String type
@RequestParam(value = "type", required = false) @ApiParam(name = "type", value = "执行命令类型") @Nullable String type,
@ApiParam(name = "isDurationTask", value = "是否是持久化任务") @RequestParam(value = "isDurationTask", defaultValue = "false", required = false) boolean isDurationTask
) {
return R.ok(
@@ -152,7 +160,8 @@ public class ExecutionController {
topicNameList,
type,
commandList,
completeCommandList
completeCommandList,
isDurationTask
)
);
}
@@ -164,7 +173,8 @@ public class ExecutionController {
@ApiParam(name = "commandList", value = "命令行") @Nullable List<String> commandList,
@RequestParam(value = "completeCommandList", required = false)
@ApiParam(name = "completeCommandList", value = "完整命令行,优先,可为空") @Nullable List<List<String>> completeCommandList,
@RequestParam(value = "type", required = false) @ApiParam(name = "type", value = "执行命令类型") @Nullable String type
@RequestParam(value = "type", required = false) @ApiParam(name = "type", value = "执行命令类型") @Nullable String type,
@ApiParam(name = "isDurationTask", value = "是否是持久化任务") @RequestParam(value = "isDurationTask", defaultValue = "false", required = false) boolean isDurationTask
) {
return R.ok(
@@ -172,7 +182,8 @@ public class ExecutionController {
ALL_AGENT_TOPIC_NAME_LIST,
type,
commandList,
completeCommandList
completeCommandList,
isDurationTask
)
);
}
@@ -207,7 +218,10 @@ public class ExecutionController {
.SendCommandToAgent(
topicNameList,
"AgentUpdate",
null
null,
false,
null,
true
));
}
@@ -223,7 +237,10 @@ public class ExecutionController {
.SendCommandToAgent(
topicNameList,
"AgentReboot",
null
null,
false,
null,
true
));
}
@@ -239,7 +256,10 @@ public class ExecutionController {
.SendCommandToAgent(
topicNameList,
"AgentShutdown",
null
null,
false,
null,
true
));
}
@@ -255,7 +275,10 @@ public class ExecutionController {
.SendCommandToAgent(
topicNameList,
"AgentBootUp",
null
null,
false,
null,
true
));
}