mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
♻️ Make the worker abstraction more scalable
Start using redis for dispatcher to worker communication and add the ability to start multiple threads to worker for increase the concurrency.
This commit is contained in:
@@ -324,7 +324,7 @@
|
||||
(run-task! name {}))
|
||||
([name params]
|
||||
(let [tasks (:app.worker/registry *system*)]
|
||||
(let [task-fn (get tasks name)]
|
||||
(let [task-fn (get tasks (d/name name))]
|
||||
(task-fn params)))))
|
||||
|
||||
;; --- UTILS
|
||||
|
||||
@@ -20,12 +20,10 @@
|
||||
(t/deftest test-base-report-data-structure
|
||||
(with-mocks [mock {:target 'app.tasks.telemetry/send!
|
||||
:return nil}]
|
||||
(let [task-fn (-> th/*system* :app.worker/registry :telemetry)
|
||||
prof (th/create-profile* 1 {:is-active true
|
||||
:props {:newsletter-news true}})]
|
||||
(let [prof (th/create-profile* 1 {:is-active true
|
||||
:props {:newsletter-news true}})]
|
||||
|
||||
;; run the task
|
||||
(task-fn {:send? true :enabled? true})
|
||||
(th/run-task! :telemetry {:send? true :enabled? true})
|
||||
|
||||
(t/is (:called? @mock))
|
||||
(let [[_ data] (-> @mock :call-args)]
|
||||
|
||||
Reference in New Issue
Block a user