fix cancel job

This commit is contained in:
Ruben Fiszel
2022-09-25 16:36:32 +02:00
parent c3ce89ec5f
commit f1fdb4e0b9

View File

@@ -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?;