Update app.py
Browse files
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 |
)
|