mirror of
https://github.com/PaiGramTeam/MibooGram.git
synced 2024-11-21 14:48:29 +00:00
🐛 Fix honey request retry return type
This commit is contained in:
parent
c53de16302
commit
1b36129dea
@ -32,15 +32,15 @@ FULL_DATA_TYPE = Dict[str, DATA_TYPE]
|
||||
client = AsyncClient()
|
||||
|
||||
|
||||
async def request(url: str, retry: int = 5) -> Optional[Response]:
|
||||
async def request(url: str, retry: int = 10) -> Optional[Response]:
|
||||
for time in range(retry):
|
||||
try:
|
||||
return await client.get(url)
|
||||
except HTTPError:
|
||||
except HTTPError as e:
|
||||
if time != retry - 1:
|
||||
await asyncio.sleep(1)
|
||||
continue
|
||||
return None
|
||||
raise e
|
||||
except Exception as e:
|
||||
raise e
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user