[ server ] [ scheduler ]- script scheduler - 3
This commit is contained in:
@@ -19,4 +19,6 @@ public class ScriptSchedulerDTO extends ScriptSchedulerVO{
|
||||
|
||||
List<String> targetMachineList;
|
||||
|
||||
List<String> resultKeyList;
|
||||
|
||||
}
|
||||
|
||||
@@ -92,6 +92,8 @@ public class QuartzSchedulerServiceImpl implements QuartzSchedulerService {
|
||||
*/
|
||||
private ScriptSchedulerPO convertToScriptSchedulerPO(ScriptSchedulerDTO dto) {
|
||||
// todo should be a static method
|
||||
|
||||
|
||||
return ScriptSchedulerPO
|
||||
.builder()
|
||||
.cronExpress(dto.getCronExpress())
|
||||
@@ -288,7 +290,8 @@ public class QuartzSchedulerServiceImpl implements QuartzSchedulerService {
|
||||
jobDetail,
|
||||
trigger
|
||||
);
|
||||
log.info(
|
||||
|
||||
log.debug(
|
||||
"jobDataMap: {}",
|
||||
jobDetail.getJobDataMap()
|
||||
);
|
||||
|
||||
@@ -3,7 +3,6 @@ package io.wdd.rpc.scheduler.service.script;
|
||||
|
||||
import io.wdd.rpc.execute.service.CoreExecutionService;
|
||||
import io.wdd.rpc.scheduler.beans.ScriptSchedulerDTO;
|
||||
import io.wdd.server.beans.po.ScriptSchedulerPO;
|
||||
import lombok.extern.log4j.Log4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -22,16 +21,17 @@ public class AgentApplyScheduledScript {
|
||||
|
||||
public void apply(ScriptSchedulerDTO scriptSchedulerDTO) {
|
||||
|
||||
List<List<String>> commandList = scriptSchedulerDTO.getCommandList();
|
||||
List<List<String>> completeCommandList = scriptSchedulerDTO.getCommandList();
|
||||
List<String> targetMachineList = scriptSchedulerDTO.getTargetMachineList();
|
||||
|
||||
targetMachineList
|
||||
.stream()
|
||||
.map(
|
||||
targetMachine -> {
|
||||
coreExecutionService.SendCommandToAgent()
|
||||
}
|
||||
)
|
||||
List<String> resultKeyList = coreExecutionService.SendCommandToAgentComplete(
|
||||
targetMachineList,
|
||||
"Scheduled Script",
|
||||
completeCommandList
|
||||
);
|
||||
|
||||
// 将 resultKeyList 放入这个DTO中
|
||||
scriptSchedulerDTO.setResultKeyList(resultKeyList);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user