mirror of
https://github.com/flibusta-apps/books_downloader.git
synced 2025-12-08 09:30:43 +01:00
Fix task cancelation
This commit is contained in:
@@ -101,7 +101,7 @@ class FLDownloader(BaseDownloader):
|
|||||||
):
|
):
|
||||||
for task in done_tasks:
|
for task in done_tasks:
|
||||||
try:
|
try:
|
||||||
data = task.result()
|
data = await task
|
||||||
|
|
||||||
await data[0].aclose()
|
await data[0].aclose()
|
||||||
await data[1].aclose()
|
await data[1].aclose()
|
||||||
@@ -129,9 +129,6 @@ class FLDownloader(BaseDownloader):
|
|||||||
data = task.result()
|
data = task.result()
|
||||||
|
|
||||||
for t_task in pending:
|
for t_task in pending:
|
||||||
if not t_task.done() or t_task.cancelled():
|
|
||||||
continue
|
|
||||||
|
|
||||||
t_task.cancel()
|
t_task.cancel()
|
||||||
|
|
||||||
await self._close_other_done(pending)
|
await self._close_other_done(pending)
|
||||||
|
|||||||
Reference in New Issue
Block a user