Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -208,9 +208,9 @@ async def make_request(session, token, data, url, index, semaphore, max_retries=
|
|
| 208 |
except aiohttp.ContentTypeError:
|
| 209 |
result_data = await response.text()
|
| 210 |
return result_data
|
| 211 |
-
except (asyncio.TimeoutError, aiohttp.ClientError) as e:
|
| 212 |
-
LoggaTesto("ERRORE ASYNC", {
|
| 213 |
-
if isinstance(e,
|
| 214 |
break
|
| 215 |
await asyncio.sleep(3)
|
| 216 |
raise Exception("Max retries reached or skipping retries. Unable to make the request.")
|
|
|
|
| 208 |
except aiohttp.ContentTypeError:
|
| 209 |
result_data = await response.text()
|
| 210 |
return result_data
|
| 211 |
+
except (asyncio.TimeoutError, aiohttp.ClientError, requests.exceptions.HTTPError) as e:
|
| 212 |
+
LoggaTesto("ERRORE ASYNC", {e}, False)
|
| 213 |
+
if isinstance(e, (asyncio.TimeoutError, requests.exceptions.HTTPError)) and e.response.status in [502, 504]:
|
| 214 |
break
|
| 215 |
await asyncio.sleep(3)
|
| 216 |
raise Exception("Max retries reached or skipping retries. Unable to make the request.")
|