set connection delay to 2s
Browse files
app.py
CHANGED
@@ -35,7 +35,7 @@ async def summarize(text, retries=3):
|
|
35 |
# retry only if the error is 503 (Service Unavailable)
|
36 |
if isinstance(e, aiohttp.ClientResponseError) and e.status == 503 and attempt < retries - 1:
|
37 |
# add a short delay before retrying
|
38 |
-
await asyncio.sleep(
|
39 |
continue
|
40 |
else:
|
41 |
return "Oops! 🙈 It looks like those mischievous monkeys🐒 might be swinging around the server, causing a bit of chaos with the cables. Please try it again!"
|
|
|
35 |
# retry only if the error is 503 (Service Unavailable)
|
36 |
if isinstance(e, aiohttp.ClientResponseError) and e.status == 503 and attempt < retries - 1:
|
37 |
# add a short delay before retrying
|
38 |
+
await asyncio.sleep(2)
|
39 |
continue
|
40 |
else:
|
41 |
return "Oops! 🙈 It looks like those mischievous monkeys🐒 might be swinging around the server, causing a bit of chaos with the cables. Please try it again!"
|