mirror of
https://github.com/logseq/logseq.git
synced 2026-05-18 09:52:22 +00:00
fix: worker-repl
This commit is contained in:
@@ -18,27 +18,11 @@
|
||||
|
||||
;; Get the runtime id from http://localhost:9630/runtimes, pick the one which shows `browser-worker`
|
||||
(defn worker-repl
|
||||
([]
|
||||
(worker-repl :old))
|
||||
([runtime-id-or-which]
|
||||
(assert runtime-id-or-which "runtime-id shouldn't be empty")
|
||||
(if
|
||||
(number? runtime-id-or-which)
|
||||
(do (prn :worker-runtime-id runtime-id-or-which)
|
||||
(api/repl :workers {:runtime-id runtime-id-or-which}))
|
||||
(let [runtime-ids (->> (api/repl-runtimes :workers)
|
||||
(filter (fn [runtime] (= :browser-worker (:host runtime))))
|
||||
(map :client-id))
|
||||
runtime-id (apply (if (= :old runtime-id-or-which) min max) runtime-ids)]
|
||||
(worker-repl runtime-id)))))
|
||||
|
||||
(defn mobile-worker-repl
|
||||
[]
|
||||
(when-let [runtime-id (->> (api/repl-runtimes :mobile)
|
||||
(filter (fn [runtime] (= :browser-worker (:host runtime))))
|
||||
(map :client-id)
|
||||
(apply max))]
|
||||
(api/repl :mobile {:runtime-id runtime-id})))
|
||||
(let [runtime-id (->> (api/repl-runtimes :db-worker)
|
||||
(map :client-id)
|
||||
first)]
|
||||
(api/repl :db-worker {:runtime-id runtime-id})))
|
||||
|
||||
(defn runtime-id-list
|
||||
[app]
|
||||
|
||||
Reference in New Issue
Block a user