From 4804274674ef4fa571e9e90b4b18362a4f88e5ff Mon Sep 17 00:00:00 2001 From: Tomperez98 Date: Mon, 6 Jan 2025 16:17:29 -0500 Subject: [PATCH] Add daemon to all threads --- src/resonate/queue.py | 2 +- src/resonate/scheduler/scheduler.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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):