Fix cancelation

This commit is contained in:
2022-04-26 10:33:25 +03:00
parent f8a9bbadf8
commit 4a80243d6b

View File

@@ -105,7 +105,13 @@ class FLDownloader(BaseDownloader):
await data[0].aclose()
await data[1].aclose()
except (NotSuccess, ReceivedHTML, ConvertationError, FileNotFoundError):
except (
NotSuccess,
ReceivedHTML,
ConvertationError,
FileNotFoundError,
ValueError,
):
continue
async def _wait_until_some_done(
@@ -122,8 +128,9 @@ class FLDownloader(BaseDownloader):
try:
data = task.result()
for p_task in pending:
p_task.cancel()
await self._close_other_done(
{ttask for ttask in pending if not ttask.cancel()}
)
await self._close_other_done(
{ttask for ttask in done if ttask != task}