catch provider timeout
This commit is contained in:
parent
05bc86a23f
commit
5969e24128
@ -100,7 +100,11 @@ async def get_any(upstream, proxy, logger):
|
|||||||
tasks.append(asyncio.create_task(get_ytdl(upstream, proxy, logger)))
|
tasks.append(asyncio.create_task(get_ytdl(upstream, proxy, logger)))
|
||||||
result = None
|
result = None
|
||||||
for task in asyncio.as_completed(tasks, timeout=5.0):
|
for task in asyncio.as_completed(tasks, timeout=5.0):
|
||||||
|
temp_result = None
|
||||||
|
try:
|
||||||
temp_result = await task
|
temp_result = await task
|
||||||
|
except Exception as e:
|
||||||
|
logger.info(e)
|
||||||
if isinstance(temp_result, str):
|
if isinstance(temp_result, str):
|
||||||
result = temp_result
|
result = temp_result
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user