Browse Source

fix [Bug][LoggerServer] task log can not refresh in time #4617

fix [Bug][LoggerServer] task log can not refresh in time #4617
pull/3/MERGE
小清 4 years ago committed by GitHub
parent
commit
bd2d0ba170
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/AbstractCommandExecutor.java

6
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/AbstractCommandExecutor.java

@ -348,12 +348,14 @@ public abstract class AbstractCommandExecutor {
long lastFlushTime = System.currentTimeMillis(); long lastFlushTime = System.currentTimeMillis();
while ((line = inReader.readLine()) != null) { while ((line = inReader.readLine()) != null || logBuffer.size()>0) {
if (line.startsWith("${setValue(")) { if (line.startsWith("${setValue(")) {
varPool.append(line.substring("${setValue(".length(), line.length() - 2)); varPool.append(line.substring("${setValue(".length(), line.length() - 2));
varPool.append("$VarPool$"); varPool.append("$VarPool$");
} else { } else {
if(null != line){
logBuffer.add(line); logBuffer.add(line);
}
lastFlushTime = flush(lastFlushTime); lastFlushTime = flush(lastFlushTime);
} }
} }
@ -560,4 +562,4 @@ public abstract class AbstractCommandExecutor {
protected abstract String commandInterpreter(); protected abstract String commandInterpreter();
protected abstract void createCommandFileIfNotExists(String execCommand, String commandFile) throws IOException; protected abstract void createCommandFileIfNotExists(String execCommand, String commandFile) throws IOException;
} }

Loading…
Cancel
Save