Fix: Make starting jobs more idempotent
This commit is contained in:
parent
e36678eba1
commit
a4f9af10b5
2 changed files with 2 additions and 1 deletions
|
@ -165,6 +165,7 @@ SET
|
||||||
started_at = datetime('now')
|
started_at = datetime('now')
|
||||||
WHERE
|
WHERE
|
||||||
id = :jid
|
id = :jid
|
||||||
|
AND started_at IS NULL
|
||||||
;
|
;
|
||||||
|
|
||||||
-- name: cancel-job!
|
-- name: cancel-job!
|
||||||
|
|
|
@ -274,7 +274,7 @@ def pull_jobs(app: App, db: Db) -> None:
|
||||||
db.finish_job(jid=job.id, state="cancelled")
|
db.finish_job(jid=job.id, state="cancelled")
|
||||||
|
|
||||||
elif printer_state.get("printing"):
|
elif printer_state.get("printing"):
|
||||||
pass
|
db.start_job(jid=job.id)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
log.warn(
|
log.warn(
|
||||||
|
|
Loading…
Reference in a new issue