mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
fix: db-worker stops working after hot-reload
This commit is contained in:
@@ -91,7 +91,6 @@
|
||||
(defn ^:export stop []
|
||||
;; stop is called before any code is reloaded
|
||||
;; this is controlled by :before-load in the config
|
||||
(handler/stop!)
|
||||
(js/console.log "stop"))
|
||||
|
||||
(defn ^:export delay-remount
|
||||
|
||||
@@ -181,11 +181,6 @@
|
||||
(reset! vector-search-flows/*infer-worker-ready true))))
|
||||
nil)))))))
|
||||
|
||||
(defn stop! []
|
||||
(db-browser/stop-workers!)
|
||||
(reset! vector-search-flows/*infer-worker-ready false)
|
||||
(prn "stop!"))
|
||||
|
||||
(defn quit-and-install-new-version!
|
||||
[]
|
||||
(p/let [_ (ipc/invoke "set-quit-dirty-state" false)]
|
||||
|
||||
@@ -57,7 +57,15 @@
|
||||
[missionary.core :as m]
|
||||
[promesa.core :as p]))
|
||||
|
||||
(.importScripts js/self "worker.js")
|
||||
(def ^:private worker-bootstrap-loaded-key "__logseq_db_worker_bootstrap_loaded__")
|
||||
|
||||
(defn- ensure-worker-bootstrap!
|
||||
[]
|
||||
(when-not (gobj/get js/self worker-bootstrap-loaded-key)
|
||||
(gobj/set js/self worker-bootstrap-loaded-key true)
|
||||
(.importScripts js/self "worker.js")))
|
||||
|
||||
(ensure-worker-bootstrap!)
|
||||
|
||||
(declare <build-blocks-fts!)
|
||||
|
||||
@@ -1171,6 +1179,7 @@
|
||||
(defn- notify-invalid-data
|
||||
[{:keys [tx-meta]} errors]
|
||||
;; don't notify on production when undo/redo failed
|
||||
|
||||
(when-not (and (or (:undo? tx-meta) (:redo? tx-meta))
|
||||
(not worker-util/dev?))
|
||||
(shared-service/broadcast-to-clients! :notification
|
||||
|
||||
Reference in New Issue
Block a user