[ server ] [ scheduler ]- script scheduler add function

This commit is contained in:
zeaslity
2023-02-06 15:35:18 +08:00
parent 2fb0252b15
commit f347cedce3
3 changed files with 38 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import io.wdd.rpc.execute.service.CoreExecutionService;
import io.wdd.rpc.scheduler.beans.ScriptSchedulerDTO;
import io.wdd.rpc.scheduler.config.QuartzSchedulerUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -31,9 +32,15 @@ public class AgentApplyScheduledScript {
HashMap<String, String> futureResultKeyMap = scriptSchedulerDTO.getAgentTopicNameToFutureResultKeyMap();
// 新增-定时调用Nacos中预编辑脚本的内容
String scriptType = scriptSchedulerDTO.getScriptType();
if (StringUtils.isEmpty(scriptType)) {
scriptType = "Scheduled Script";
}
List<String> resultKeyList = coreExecutionService.SendCommandToAgentComplete(
targetMachineList,
"Scheduled Script",
scriptType,
completeCommandList,
futureResultKeyMap
);