From 35421540d7fe0f003331deae7c7d17e8754715a9 Mon Sep 17 00:00:00 2001 From: ArabCoders Date: Sat, 18 Jan 2025 19:09:48 +0300 Subject: [PATCH] another attempt to fix multi-processing #173 --- app/library/Download.py | 4 +++- app/library/DownloadQueue.py | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/library/Download.py b/app/library/Download.py index a8d63b32..d94691a2 100644 --- a/app/library/Download.py +++ b/app/library/Download.py @@ -28,7 +28,6 @@ class Download: """ id: str = None - manager = None download_dir: str = None temp_dir: str = None output_template: str = None @@ -319,6 +318,9 @@ class Download: return try: status = await self.update_task + except FileNotFoundError: + LOG.debug(f"Closing progress update for: {self.info._id=} {status=}.") + return except Exception as e: LOG.error(f"Failed to get status update for: {self.info._id=}. {e}") LOG.exception(e) diff --git a/app/library/DownloadQueue.py b/app/library/DownloadQueue.py index 323aec9e..b6882a97 100644 --- a/app/library/DownloadQueue.py +++ b/app/library/DownloadQueue.py @@ -468,6 +468,7 @@ class DownloadQueue: await entry.close() if self.queue.exists(key=id): + LOG.debug(f"Download '{id}' is done. Removing from queue.") self.queue.delete(key=id) if entry.is_canceled() is True: @@ -477,6 +478,8 @@ class DownloadQueue: self.done.put(value=entry) asyncio.create_task(self.emitter.completed(dl=entry.info.serialize()), name=f"notifier-d-{id}") + else: + LOG.warning(f"Download '{id}' not found in queue.") if self.event: self.event.set()