We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2a98f70 commit e0c5714Copy full SHA for e0c5714
1 file changed
api/api.py
@@ -361,9 +361,9 @@ async def event_generator():
361
yield f"event: status\ndata: {final_status_data}\n\n"
362
print(f"Job {job_id} reached terminal state: {job.status}. Closing stream.")
363
break # Exit loop after sending final status
364
-
365
- # Wait before checking again only if not terminal
366
- await asyncio.sleep(1) # Check every 1 second
+ else:
+ # Wait before checking again only if not terminal
+ await asyncio.sleep(1) # Check every 1 second
367
if is_terminal:
368
# Send final status event
369
final_data = json.dumps({"status": job.status, "message": "Job finished."})
0 commit comments