From feafec17f4e94bf779a5aa87b290db37e14e7539 Mon Sep 17 00:00:00 2001 From: zeaslity Date: Sat, 25 Feb 2023 22:29:32 +0800 Subject: [PATCH] [agent][executor]- bug - 4 --- .../io/wdd/agent/executor/CommandExecutor.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/agent/src/main/java/io/wdd/agent/executor/CommandExecutor.java b/agent/src/main/java/io/wdd/agent/executor/CommandExecutor.java index 8fc521c..072f762 100644 --- a/agent/src/main/java/io/wdd/agent/executor/CommandExecutor.java +++ b/agent/src/main/java/io/wdd/agent/executor/CommandExecutor.java @@ -131,14 +131,8 @@ public class CommandExecutor { octopusMessage )); - // 缓存 命令处理日志 - commandExecLogCache.cacheLog( - streamKey, - process - ); - // 等待1秒钟, 使得有时间进行后端任务的完成 - TimeUnit.SECONDS.sleep(1); + //TimeUnit.SECONDS.sleep(1); // get the command result must also be a timeout smaller than the process // 此处会把主线程卡死, forever终结 @@ -190,8 +184,6 @@ public class CommandExecutor { System.out.println("process isAlive = " + process.isAlive()); - // 对线程进行debug - commandExecLogCache.debugProcessStreams(process); // 任务提前执行结束,或者超过了最长等待时间 // 判断命令是否正确处理完成 @@ -217,11 +209,19 @@ public class CommandExecutor { .get() ); + // 对线程进行debug + commandExecLogCache.debugProcessStreams(process); process.destroy(); } } + // 缓存 命令处理日志 + commandExecLogCache.cacheLog( + streamKey, + process + ); + // 日志操作,如果需要显示回传,需要将日志发送回相应的 /*collectCommandLogAndRepeat( streamKey,