From d3d55691a7150090b7e57460598ec28cc82afbef Mon Sep 17 00:00:00 2001 From: Reid 'arrdem' McKenzie Date: Sat, 3 Jun 2023 19:53:29 -0600 Subject: [PATCH] Bugfix: don't mark successes as failures by accident --- projects/tentacles/src/python/tentacles/schema.sql | 1 + projects/tentacles/src/python/tentacles/workers.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/tentacles/src/python/tentacles/schema.sql b/projects/tentacles/src/python/tentacles/schema.sql index 7c8cfc0..6093a96 100644 --- a/projects/tentacles/src/python/tentacles/schema.sql +++ b/projects/tentacles/src/python/tentacles/schema.sql @@ -576,6 +576,7 @@ SET , message = :message WHERE id = :jid + AND finished_at IS NULL -- guard against calling this twice ; -- name: delete-job! diff --git a/projects/tentacles/src/python/tentacles/workers.py b/projects/tentacles/src/python/tentacles/workers.py index af0dcc5..5e9ba66 100644 --- a/projects/tentacles/src/python/tentacles/workers.py +++ b/projects/tentacles/src/python/tentacles/workers.py @@ -230,7 +230,7 @@ def pull_jobs(app: App, db: Db) -> None: log.info(f"Job {job.id} has been acknowledged as cancelled") db.finish_job(jid=job.id, state="cancelled") - if printer_state.get("printing"): + elif printer_state.get("printing"): pass else: