File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -212,6 +212,7 @@ def get_line_count(file_path: str) -> int:
212212 n_lines = wc_result .stdout .decode ('utf-8' ).splitlines ()[0 ].split ()[0 ]
213213 return int (n_lines )
214214
215+ exitcode_found = False
215216 while True :
216217 try :
217218 # get the number of lines in stdout and stderr
@@ -227,7 +228,14 @@ def get_line_count(file_path: str) -> int:
227228 # do we have an exit code file? (it is only generated when the process has terminated)
228229 if check_if_path_exists (paths ['exitcode' ], ssh_credentials = ssh_credentials , timeout = 10 ):
229230 logger .info (f"end monitoring { pid } on { 'REMOTE' if ssh_credentials else 'LOCAL' } machine." )
230- break
231+
232+ if not exitcode_found :
233+ # set the flag, wait a second to allow stdout/stderr to flush, then give it another round
234+ exitcode_found = True
235+ time .sleep (1.0 )
236+ continue
237+ else :
238+ break
231239
232240 # do we have new STDOUT lines to process?
233241 if d_stdout_lines > 0 :
You can’t perform that action at this time.
0 commit comments