Skip to content

Commit

Permalink
overwrite birdy.client._console_method to skip signal
Browse files Browse the repository at this point in the history
  • Loading branch information
cehbrecht committed May 14, 2024
1 parent 161f308 commit 750b993
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions rooki/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,30 @@ def _execute(self, pid, **kwargs):
except Exception:
raise RuntimeError("execution failed")
return Result(resp, output_dir=self.output_dir)

def _console_monitor(self, execution, sleep=3):
"""
TODO: overwrites birdy method to avoid conflict with usage of signal and dask.
"""
# import signal

# # Intercept CTRL-C
# def sigint_handler(signum, frame):
# self.cancel()

# signal.signal(signal.SIGINT, sigint_handler)

while not execution.isComplete():
execution.checkStatus(sleepSecs=sleep)
self.logger.info(
"{} [{}/100] - {} ".format(
execution.process.identifier,
execution.percentCompleted,
execution.statusMessage[:50],
)
)

if execution.isSucceded():
self.logger.info(f"{execution.process.identifier} done.")
else:
self.logger.info(f"{execution.process.identifier} failed.")

0 comments on commit 750b993

Please sign in to comment.