💄 Check the runner task exists as first condition

This commit is contained in:
Andrey Antukh
2025-11-04 09:58:24 +01:00
parent 37aa59b164
commit eaabe54c4b

View File

@@ -131,6 +131,11 @@
[{:keys [::id ::timeout] :as cfg} task-id scheduled-at]
(loop [task (get-task cfg task-id)]
(cond
(nil? task)
(l/wrn :hint "no task found on the database"
:runner-id id
:task-id task-id)
(ex/exception? task)
(if (or (db/connection-error? task)
(db/serialization-error? task))
@@ -153,11 +158,6 @@
:task-id task-id
:runner-id id)
(nil? task)
(l/wrn :hint "no task found on the database"
:runner-id id
:task-id task-id)
:else
(let [result (run-task cfg task)]
(with-meta result