Skip to content

Commit

Permalink
logged, but did not process leftover results.
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeByDrescher committed Nov 26, 2024
1 parent c1febf9 commit 04b464c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions vcell-cli/src/main/java/org/vcell/cli/CLIPythonManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,16 @@ private String callPython(String command) throws PythonStreamException, TimeoutE
}
} catch (IOException | InterruptedException e4){
throw new PythonStreamException("Python process encountered an exception:\n" + e4.getMessage(), e4);
} finally { // Let's make sure our buffer isn't clogged; for now, we'll log, but discard any extra output
StringBuilder remainder = new StringBuilder("Leftovers in buffer: \n");
try {
while (this.pythonISB.ready()){
remainder.append(this.getResultsOfLastCommand()).append("\n");
}
} catch (IOException | InterruptedException cleaningException){
lg.warn("Received exception while trying to clear buffer:", cleaningException);
}
lg.debug(remainder.toString());
}
}
}
Expand Down

0 comments on commit 04b464c

Please sign in to comment.