Keep asyncio sleep
This commit is contained in:
parent
7707b818f0
commit
b70f55c9cc
@ -1,7 +1,7 @@
|
||||
import asyncio
|
||||
import logging
|
||||
import random
|
||||
from asyncio.exceptions import TimeoutError
|
||||
from time import sleep
|
||||
from typing import Any, Callable, Collection, Coroutine, Type
|
||||
|
||||
from aiohttp.client_exceptions import (
|
||||
@ -67,9 +67,7 @@ async def exception_retry_with_backoff_middleware(
|
||||
backoff_time = backoff_time_seconds * (
|
||||
random.uniform(5, 10) ** i
|
||||
)
|
||||
# use blocking sleep to prevent new tries on
|
||||
# concurrent requests during sleep
|
||||
sleep(backoff_time)
|
||||
await asyncio.sleep(backoff_time)
|
||||
continue
|
||||
else:
|
||||
raise
|
||||
|
Loading…
x
Reference in New Issue
Block a user