From 7f5a0b87f20e6d43ecaaf3b11b27c62cd72ca867 Mon Sep 17 00:00:00 2001 From: g0ldyy <153996346+g0ldyy@users.noreply.github.com> Date: Wed, 10 Dec 2025 19:01:24 +0100 Subject: [PATCH] refactor: ensure proper stopping of AddTorrentQueue - Moved the setting of 'is_running' to after the queue join in the stop method for clearer logic flow. - This change ensures that the queue is fully processed before marking the queue as not running. --- comet/services/torrent_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comet/services/torrent_manager.py b/comet/services/torrent_manager.py index b6cfd68..97fabd7 100644 --- a/comet/services/torrent_manager.py +++ b/comet/services/torrent_manager.py @@ -239,9 +239,9 @@ class AddTorrentQueue: self.is_running = False async def stop(self): - self.is_running = False if not self.queue.empty(): await self.queue.join() + self.is_running = False add_torrent_queue = AddTorrentQueue()