mirror of
https://github.com/g0ldyy/comet.git
synced 2026-01-12 01:16:12 +01:00
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.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user