Created
October 5, 2019 13:08
-
-
Save igorzakhar/c5da6b85fbc4e58a39a2a47c8ad2868a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while True: | |
try: | |
async with session.get(url, timeout=5) as response: | |
... | |
... | |
except asyncio.TimeoutError: | |
print('Timeout Error') | |
await asyncio.sleep(5) # можно подождать перед повторным запросом | |
continue | |
else: | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment