|
|
@ -318,6 +318,11 @@ public class CMDService { |
|
|
|
for (Supplier<Boolean> command : cmdList) { |
|
|
|
|
|
|
|
boolean result = command.get(); |
|
|
|
try { |
|
|
|
Thread.sleep(100); |
|
|
|
} catch (InterruptedException e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
if(!running) { |
|
|
|
log.error("指令线程停止: {}", JSONUtil.toJsonStr(form)); |
|
|
|
executionResult.setStatus(CMDResultCode.FAILURE.getCode()); |
|
|
@ -330,13 +335,13 @@ public class CMDService { |
|
|
|
// } catch (InterruptedException e) { |
|
|
|
// throw new RuntimeException(e); |
|
|
|
// } |
|
|
|
// if (!result) { |
|
|
|
// log.error("指令执行异常: {}", JSONUtil.toJsonStr(form)); |
|
|
|
// executionResult.setStatus(CMDResultCode.FAILURE.getCode()); |
|
|
|
// executionResult.setMessage(CMDResultCode.FAILURE.getMsg()); |
|
|
|
// webSocketService.pushMsg(WebSocketMessageType.CMD, executionResult); |
|
|
|
// return; |
|
|
|
// } |
|
|
|
if (!result) { |
|
|
|
log.error("指令执行异常: {}", JSONUtil.toJsonStr(form)); |
|
|
|
executionResult.setStatus(CMDResultCode.FAILURE.getCode()); |
|
|
|
executionResult.setMessage(CMDResultCode.FAILURE.getMsg()); |
|
|
|
webSocketService.pushMsg(WebSocketMessageType.CMD, executionResult); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
log.info("指令执行成功: {}", JSONUtil.toJsonStr(form)); |
|
|
|
executionResult.setStatus(CMDResultCode.SUCCESS.getCode()); |
|
|
|