mirror of
https://github.com/flibusta-apps/books_downloader.git
synced 2025-12-06 15:05:37 +01:00
Fix cancelation
This commit is contained in:
@@ -105,7 +105,13 @@ class FLDownloader(BaseDownloader):
|
|||||||
|
|
||||||
await data[0].aclose()
|
await data[0].aclose()
|
||||||
await data[1].aclose()
|
await data[1].aclose()
|
||||||
except (NotSuccess, ReceivedHTML, ConvertationError, FileNotFoundError):
|
except (
|
||||||
|
NotSuccess,
|
||||||
|
ReceivedHTML,
|
||||||
|
ConvertationError,
|
||||||
|
FileNotFoundError,
|
||||||
|
ValueError,
|
||||||
|
):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
async def _wait_until_some_done(
|
async def _wait_until_some_done(
|
||||||
@@ -122,8 +128,9 @@ class FLDownloader(BaseDownloader):
|
|||||||
try:
|
try:
|
||||||
data = task.result()
|
data = task.result()
|
||||||
|
|
||||||
for p_task in pending:
|
await self._close_other_done(
|
||||||
p_task.cancel()
|
{ttask for ttask in pending if not ttask.cancel()}
|
||||||
|
)
|
||||||
|
|
||||||
await self._close_other_done(
|
await self._close_other_done(
|
||||||
{ttask for ttask in done if ttask != task}
|
{ttask for ttask in done if ttask != task}
|
||||||
|
|||||||
Reference in New Issue
Block a user