Skip to content

Commit

Permalink
Merge pull request #10 from joknarf/log_view
Browse files Browse the repository at this point in the history
interrupt printq statuses
  • Loading branch information
joknarf authored Jul 8, 2024
2 parents cc6eef7 + 2aee27f commit 5adb3c8
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions ssh_para/ssh_para.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,18 +369,24 @@ def join(self, *args):

def interrupt(self, jstatus):
"""sigint handler to log/print summary"""
self.abort_jobs()
if jstatus and jstatus.exit in [-2, 255]:

if jstatus and jstatus.exit in [-2, 255, 4294967295]:
jstatus.status = "KILLED"
jstatus.exit = 256
for jstatus in self.th_status:
if jstatus.status != "IDLE" and jstatus.exit == None:
if jstatus.fdlog:
jstatus.fdlog.close()
jstatus.status="KILLED"
jstatus.exit = 256
self.nbfailed += 1
while True:
try:
jstatus = printq.get(block=False)
if not jstatus.fdlog:
jstatus.fdlog = open(jstatus.logfile, "rb")
jstatus.log = last_line(jstatus.fdlog)
jstatus.fdlog.close()
if jstatus.exit in [-2, 255, 4294967295]:
jstatus.status = "KILLED"
jstatus.exit = 256
self.job_status.append(jstatus)
except queue.Empty:
break
self.abort_jobs()
try:
curses.endwin()
except curses.error:
Expand Down

0 comments on commit 5adb3c8

Please sign in to comment.