Commit baaf705a by huangfusuper

调度命令处理

parent 7a96631b
...@@ -6,9 +6,11 @@ import com.byit.node.ProcessingNodeChain; ...@@ -6,9 +6,11 @@ import com.byit.node.ProcessingNodeChain;
import com.byit.node.machine.ProcessingMachine; import com.byit.node.machine.ProcessingMachine;
import com.byit.process.MythJobProcess; import com.byit.process.MythJobProcess;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
...@@ -35,12 +37,18 @@ public class RunScriptProcessingMachine implements ProcessingMachine { ...@@ -35,12 +37,18 @@ public class RunScriptProcessingMachine implements ProcessingMachine {
public void executor(ScriptDto scriptDto, ProcessingNodeChain processingNodeChain) { public void executor(ScriptDto scriptDto, ProcessingNodeChain processingNodeChain) {
try { try {
boolean isRunNode = scriptDto.getRunId().contains("REAL:EXEC:"); boolean isRunNode = scriptDto.getRunId().contains("REAL:EXEC:");
List<String> cmdList = Arrays.asList(scriptDto.getCommand()); List<String> cmdList = Arrays.asList(scriptDto.getCommand().split(" "));
List<String> newCmdList = new ArrayList<>();
cmdList.forEach(cmd ->{
if (StringUtils.isNotBlank(cmd)) {
newCmdList.add(cmd);
}
});
MythJobProcess mythJobProcess; MythJobProcess mythJobProcess;
if(isRunNode) { if(isRunNode) {
mythJobProcess = new MythJobProcess(cmdList, null, null, scriptDto.getLogId(), stringRedisTemplate); mythJobProcess = new MythJobProcess(newCmdList, null, null, scriptDto.getLogId(), stringRedisTemplate);
}else { }else {
mythJobProcess = new MythJobProcess(cmdList, null, null, scriptDto.getLogId(), null); mythJobProcess = new MythJobProcess(newCmdList, null, null, scriptDto.getLogId(), null);
} }
//保存日志 //保存日志
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment