From f1fdb4e0b93f2b6de719202811deadbd5380edc5 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sun, 25 Sep 2022 16:36:32 +0200 Subject: [PATCH] fix cancel job --- backend/src/jobs.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/src/jobs.rs b/backend/src/jobs.rs index 9e9f1e6c66..2497bb33d3 100644 --- a/backend/src/jobs.rs +++ b/backend/src/jobs.rs @@ -778,7 +778,7 @@ async fn cancel_job( let job_option = sqlx::query_scalar!( "UPDATE queue SET canceled = true, canceled_by = $1, canceled_reason = $2 WHERE id = $3 \ - AND schedule_path IS NULL AND workspace_id = $4RETURNING id", + AND schedule_path IS NULL AND workspace_id = $4 RETURNING id", &authed.username, reason, id, @@ -791,13 +791,14 @@ async fn cancel_job( audit_log( &mut tx, &authed.username, - "jobs.delete", + "jobs.cancel", ActionKind::Delete, &w_id, Some(&id.to_string()), None, ) .await?; + tx.commit().await?; Ok(id.to_string()) } else { let (job_o, tx) = get_job_by_id(tx, &w_id, id).await?;