Rahmat82 commited on
Commit
1fa3f20
·
verified ·
1 Parent(s): 1110500

set connection delay to 2s

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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(1.5)
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!"