♻️ Add API consistency fixes for task calling

Also adds a helper for calling tasks synchronously
This commit is contained in:
Andrey Antukh 2024-06-25 11:56:23 +02:00
parent aa1cf3e03a
commit ec4260830c
19 changed files with 145 additions and 152 deletions

View file

@ -110,8 +110,8 @@
(defmethod ig/init-key ::handler
[_ {:keys [::min-age] :as cfg}]
(fn [params]
(let [min-age (dt/duration (or (:min-age params) min-age))]
(fn [{:keys [props] :as task}]
(let [min-age (dt/duration (or (:min-age props) min-age))]
(db/tx-run! cfg (fn [cfg]
(let [cfg (assoc cfg ::min-age min-age)
total (clean-deleted! cfg)]