diff --git a/hermes_cli/web_server.py b/hermes_cli/web_server.py index fa270747528..2ba21a8ed95 100644 --- a/hermes_cli/web_server.py +++ b/hermes_cli/web_server.py @@ -10481,7 +10481,10 @@ async def cron_fire_webhook(request: Request): if not job_id: return JSONResponse({"error": "missing job_id"}, status_code=400) - profile = _find_cron_job_profile(job_id) + # _find_cron_job_profile walks every profile and lists its jobs (file + # I/O per profile) — run it off the event loop like the other cron + # dashboard endpoints. + profile = await _run_cron_dashboard_io(_find_cron_job_profile, job_id) if not profile: # Job is gone (cancelled / completed) — nothing to fire. 200 so NAS # does not retry a fire that is intentionally absent. @@ -10556,7 +10559,11 @@ async def instantiate_blueprint(body: AutomationBlueprintInstantiate, profile: s # Blueprint-created jobs deliver to the dashboard's configured target by # default; the form's deliver slot overrides via spec["deliver"]. spec.pop("origin", None) - return _call_cron_for_profile(profile, "create_job", **spec) + # create_job does per-profile file I/O — keep it off the event loop + # like the sibling cron endpoints (partial avoids **spec keys ever + # colliding with the wrapper's own parameters). + _create = functools.partial(_call_cron_for_profile, profile, "create_job", **spec) + return await _run_cron_dashboard_io(_create) except HTTPException: raise except Exception as e: