Skip to content

Commit e0c5714

Browse files
committed
ストリームジョブステータスの待機ロジックを修正
1 parent 2a98f70 commit e0c5714

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

api/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,9 @@ async def event_generator():
361361
yield f"event: status\ndata: {final_status_data}\n\n"
362362
print(f"Job {job_id} reached terminal state: {job.status}. Closing stream.")
363363
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
364+
else:
365+
# Wait before checking again only if not terminal
366+
await asyncio.sleep(1) # Check every 1 second
367367
if is_terminal:
368368
# Send final status event
369369
final_data = json.dumps({"status": job.status, "message": "Job finished."})

0 commit comments

Comments
 (0)