mirror of
https://github.com/penpot/penpot.git
synced 2025-08-01 02:28:27 +02:00
♻️ Add API consistency fixes for task calling
Also adds a helper for calling tasks synchronously
This commit is contained in:
parent
aa1cf3e03a
commit
ec4260830c
19 changed files with 145 additions and 152 deletions
|
@ -34,6 +34,7 @@
|
|||
[app.util.blob :as blob]
|
||||
[app.util.services :as sv]
|
||||
[app.util.time :as dt]
|
||||
[app.worker :as wrk]
|
||||
[app.worker.runner]
|
||||
[clojure.java.io :as io]
|
||||
[clojure.spec.alpha :as s]
|
||||
|
@ -377,9 +378,9 @@
|
|||
([name]
|
||||
(run-task! name {}))
|
||||
([name params]
|
||||
(let [tasks (:app.worker/registry *system*)]
|
||||
(let [task-fn (get tasks (d/name name))]
|
||||
(task-fn params)))))
|
||||
(wrk/invoke! (-> *system*
|
||||
(assoc ::wrk/task name)
|
||||
(assoc ::wrk/params params)))))
|
||||
|
||||
(def sql:pending-tasks
|
||||
"select t.* from task as t
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue