[agent][executor]- bug - 9

This commit is contained in:
zeaslity
2023-02-26 11:58:48 +08:00
parent 315e07f7b9
commit f2be1dfb5c

View File

@@ -95,15 +95,11 @@ public class CommandExecLogCache {
TimeUtils.currentTimeString() TimeUtils.currentTimeString()
); );
String execResultString = String.format(
"execution result is => [ %s ]",
process.exitValue()
);
// add the command // add the command
commandCachedLog.add(execCommandString); commandCachedLog.add(execCommandString);
commandCachedLog.add(execTimeString); commandCachedLog.add(execTimeString);
commandCachedLog.add(execResultString);
commandCachedLog.add("--------------- command result are as below --------------------"); commandCachedLog.add("--------------- command result are as below --------------------");
commandCachedLog.add(""); commandCachedLog.add("");
@@ -121,7 +117,6 @@ public class CommandExecLogCache {
bufferedReader bufferedReader
); );
// !! 此处会阻塞 // !! 此处会阻塞
// 阻塞读取命令执行日志的输出流 // 阻塞读取命令执行日志的输出流
bufferedReader bufferedReader
@@ -130,6 +125,13 @@ public class CommandExecLogCache {
commandCachedLog::add commandCachedLog::add
); );
String execResultString = String.format(
"execution result is => [ %s ]",
process.exitValue()
);
commandCachedLog.add(execResultString);
log.debug( log.debug(
"命令代码 [ {} ] 的执行日志内容为 {} ", "命令代码 [ {} ] 的执行日志内容为 {} ",
streamKey, streamKey,