Skip to content

Commit

Permalink
fix running pio kill on pumps in succession too quicky
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Nov 27, 2024
1 parent 0e38e20 commit f788d2c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pioreactor/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ def __enter__(self) -> managed_lifecycle:
try:
# this only works on the main thread.
append_signal_handler(signal.SIGTERM, self._exit)
append_signal_handler(signal.SIGINT, [self._exit, lambda *args: signal.signal(signal.SIGINT, signal.SIG_IGN)]) # ignore future sigints so we clean up properly.
append_signal_handler(
signal.SIGINT, [self._exit, lambda *args: signal.signal(signal.SIGINT, signal.SIG_IGN)]
) # ignore future sigints so we clean up properly.
except ValueError:
pass

Expand Down Expand Up @@ -504,8 +506,8 @@ def kill_jobs(self) -> int:

return len(self.list_of_pids)

class JobManager:

class JobManager:
def __init__(self) -> None:
db_path = f"{tempfile.gettempdir()}/local_intermittent_pioreactor_metadata.sqlite"
self.conn = sqlite3.connect(db_path)
Expand Down

0 comments on commit f788d2c

Please sign in to comment.