diff --git a/src/resonate/queue.py b/src/resonate/queue.py index 99520a55..f7be52fb 100644 --- a/src/resonate/queue.py +++ b/src/resonate/queue.py @@ -30,7 +30,7 @@ def __init__(self) -> None: def start(self, cmd_queue: CommandQ) -> None: assert self._worker_thread is None, "Already been started." - self._worker_thread = Thread(target=self._run, args=(cmd_queue,)) + self._worker_thread = Thread(target=self._run, args=(cmd_queue,), daemon=True) self._worker_thread.start() def stop(self) -> None: diff --git a/src/resonate/scheduler/scheduler.py b/src/resonate/scheduler/scheduler.py index fa41e124..56b442dd 100644 --- a/src/resonate/scheduler/scheduler.py +++ b/src/resonate/scheduler/scheduler.py @@ -86,7 +86,7 @@ def __init__( self._delay_queue = DelayQueue() self._heartbeat_thread = Thread(target=self._heartbeat, daemon=True) - self._scheduler_thread = Thread(target=self._loop) + self._scheduler_thread = Thread(target=self._loop, daemon=True) def start(self) -> None: if isinstance(self._store, RemoteStore):