Skip to content

Commit b683c37

Browse files
committed
revert: restore async for in handle_completed_job
Modal environment requires async for Sandbox.list(). The TypeError seen earlier was likely a transient Modal runtime issue, not a sync/async mismatch. Reverting my incorrect fix.
1 parent 68b2fee commit b683c37

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

runner/services/job_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ async def handle_completed_job(app: modal.App, payload: dict) -> dict:
355355
conclusion = workflow_job.get("conclusion", "")
356356

357357
if conclusion == "cancelled":
358-
for sb in modal.Sandbox.list(app_id=app.app_id, tags={"job_id": job_id}):
358+
async for sb in modal.Sandbox.list(app_id=app.app_id, tags={"job_id": job_id}):
359359
if sb.poll() is None:
360360
logger.info("Terminating sandbox for cancelled job", extra={"job_id": job_id})
361361
try:

0 commit comments

Comments
 (0)