fix: add db-worker-ready-flow to avoid calling <invoke-db-worker too early

This commit is contained in:
rcmerci
2025-06-01 18:18:38 +08:00
parent f7acef9cd2
commit 664bf21f50
2 changed files with 10 additions and 2 deletions

View File

@@ -35,6 +35,12 @@
(defonce *db-worker (atom nil))
(defonce *editor-info (atom nil))
(def db-worker-ready-flow
"`<invoke-db-worker` throws err if `*db-worker` not ready yet.
Use this flow to wait till db-worker ready."
(->> (m/watch *db-worker)
(m/eduction (map some?))))
(defn- <invoke-db-worker*
[qkw direct-pass-args? args-list]
(let [worker @*db-worker]