commandJobHandler无法执行带参数的命令
y7could opened this issue · 0 comments
y7could commented
例如:在配置任务时,任务参数传入:/usr/local/nginx -s reload
会出现:command exit value(-1) is failed
如果需要支持这样的需要改源码:commandJobHandler方法中对参数进行切割
String command = XxlJobHelper.getJobParam();
if (command == null) {
XxlJobHelper.handleFail("command null is failed");
return;
}
List<String> commands = new ArrayList<>(Arrays.asList(command.split(" ")));
.....
processBuilder.command(commands);//传入切割好的进去