Skip to main content

serve_pause_resume

Function serve_pause_resume 

Source
pub fn serve_pause_resume(
    connection: &mut PgConnection,
    corpus_name: &str,
    service_name: &str,
    owner: &str,
    pause: bool,
) -> Result<usize, Status>
Expand description

Pause (pause = true) or resume a whole (corpus, service) run, over the caller-supplied (pooled) connection, attributed to the authenticated owner. Pause blocks every in-progress task (status >= 0 → Blocked) so the dispatcher stops leasing them; resume returns every Blocked task to TODO so the dispatcher picks them up again — the inverse pair. 404 on an unknown corpus/service, 500 if the status update fails; on success returns the number of tasks affected. Shared by the human POST /{pause,resume}/<c>/<s> (cookie) and the agent POST /api/reports/<c>/<s>/{pause,resume} (token) — one core, identical effect.