mirror of
https://github.com/logseq/logseq.git
synced 2026-05-05 19:36:35 +00:00
reset *sync-entered when sync stopped
This commit is contained in:
@@ -2929,6 +2929,9 @@
|
||||
(reset! current-sm-graph-uuid graph-uuid)
|
||||
(sync-manager user-uuid graph-uuid base-path repo txid *sync-state)))
|
||||
|
||||
;; Avoid sync reentrancy
|
||||
(defonce *sync-entered? (atom false))
|
||||
|
||||
(defn <sync-stop []
|
||||
(go
|
||||
(when-let [sm ^SyncManager (state/get-file-sync-manager (state/get-current-file-sync-graph-uuid))]
|
||||
@@ -2938,6 +2941,8 @@
|
||||
|
||||
(<! (-stop! sm))
|
||||
|
||||
(reset! *sync-entered? false)
|
||||
|
||||
(println "[SyncManager" (:graph-uuid sm) "]" "stopped"))
|
||||
|
||||
(reset! current-sm-graph-uuid nil)))
|
||||
@@ -2996,8 +3001,6 @@
|
||||
|
||||
(declare network-online-cursor)
|
||||
|
||||
;; Avoid reentrancy
|
||||
(defonce *sync-entered? (atom false))
|
||||
(defn sync-start
|
||||
[]
|
||||
(when (false? @*sync-entered?)
|
||||
|
||||
Reference in New Issue
Block a user