AliJabbarpour commited on
Commit
b3278a7
·
verified ·
1 Parent(s): bdc4daf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -257,6 +257,10 @@ async def run_with_heartbeat(websocket, blocking_fn, *args, status, detail, max_
257
  elapsed += HEARTBEAT_SEC
258
  if elapsed >= max_seconds:
259
  task.cancel()
 
 
 
 
260
  raise ProcessingTimeout(
261
  f"مرحله‌ی «{detail}» بیشتر از {max_seconds} ثانیه طول کشید و متوقف شد."
262
  )
 
257
  elapsed += HEARTBEAT_SEC
258
  if elapsed >= max_seconds:
259
  task.cancel()
260
+ try:
261
+ await task
262
+ except (asyncio.CancelledError, Exception):
263
+ pass
264
  raise ProcessingTimeout(
265
  f"مرحله‌ی «{detail}» بیشتر از {max_seconds} ثانیه طول کشید و متوقف شد."
266
  )