another attempt to fix multi-processing #173
This commit is contained in:
parent
3f2b9feb7d
commit
35421540d7
2 changed files with 6 additions and 1 deletions
|
|
@ -28,7 +28,6 @@ class Download:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
id: str = None
|
id: str = None
|
||||||
manager = None
|
|
||||||
download_dir: str = None
|
download_dir: str = None
|
||||||
temp_dir: str = None
|
temp_dir: str = None
|
||||||
output_template: str = None
|
output_template: str = None
|
||||||
|
|
@ -319,6 +318,9 @@ class Download:
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
status = await self.update_task
|
status = await self.update_task
|
||||||
|
except FileNotFoundError:
|
||||||
|
LOG.debug(f"Closing progress update for: {self.info._id=} {status=}.")
|
||||||
|
return
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.error(f"Failed to get status update for: {self.info._id=}. {e}")
|
LOG.error(f"Failed to get status update for: {self.info._id=}. {e}")
|
||||||
LOG.exception(e)
|
LOG.exception(e)
|
||||||
|
|
|
||||||
|
|
@ -468,6 +468,7 @@ class DownloadQueue:
|
||||||
await entry.close()
|
await entry.close()
|
||||||
|
|
||||||
if self.queue.exists(key=id):
|
if self.queue.exists(key=id):
|
||||||
|
LOG.debug(f"Download '{id}' is done. Removing from queue.")
|
||||||
self.queue.delete(key=id)
|
self.queue.delete(key=id)
|
||||||
|
|
||||||
if entry.is_canceled() is True:
|
if entry.is_canceled() is True:
|
||||||
|
|
@ -477,6 +478,8 @@ class DownloadQueue:
|
||||||
|
|
||||||
self.done.put(value=entry)
|
self.done.put(value=entry)
|
||||||
asyncio.create_task(self.emitter.completed(dl=entry.info.serialize()), name=f"notifier-d-{id}")
|
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:
|
if self.event:
|
||||||
self.event.set()
|
self.event.set()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue