mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
enhance(debug): capture sync replay diagnostics
This commit is contained in:
@@ -548,6 +548,18 @@
|
||||
[repo]
|
||||
(db-sync/upload-graph! repo))
|
||||
|
||||
(def-thread-api :thread-api/db-sync-stop-upload
|
||||
[repo]
|
||||
(db-sync/stop-upload! repo))
|
||||
|
||||
(def-thread-api :thread-api/db-sync-resume-upload
|
||||
[repo]
|
||||
(db-sync/resume-upload! repo))
|
||||
|
||||
(def-thread-api :thread-api/db-sync-upload-stopped?
|
||||
[repo]
|
||||
(db-sync/upload-stopped? repo))
|
||||
|
||||
(def-thread-api :thread-api/db-sync-download-graph
|
||||
[repo graph-id graph-e2ee?]
|
||||
(sync-download/download-graph-by-id! repo graph-id graph-e2ee?))
|
||||
|
||||
@@ -8,3 +8,26 @@
|
||||
(get @state/state (keyword path))
|
||||
@state/state)
|
||||
(bean/->js)))
|
||||
|
||||
(defn- current-repo-or-throw
|
||||
[]
|
||||
(if-let [repo (state/get-current-repo)]
|
||||
repo
|
||||
(throw (ex-info "No current repo" {:type :debug/no-current-repo}))))
|
||||
|
||||
(defn ^:export syncStopUpload
|
||||
[]
|
||||
(state/<invoke-db-worker :thread-api/db-sync-stop-upload (current-repo-or-throw)))
|
||||
|
||||
(defn ^:export syncResumeUpload
|
||||
[]
|
||||
(state/<invoke-db-worker :thread-api/db-sync-resume-upload (current-repo-or-throw)))
|
||||
|
||||
(defn ^:export syncUploadStopped
|
||||
[]
|
||||
(state/<invoke-db-worker :thread-api/db-sync-upload-stopped? (current-repo-or-throw)))
|
||||
|
||||
;; Snake_case aliases for consistency with existing debug exports.
|
||||
(defn ^:export sync_stop_upload [] (syncStopUpload))
|
||||
(defn ^:export sync_resume_upload [] (syncResumeUpload))
|
||||
(defn ^:export sync_upload_stopped [] (syncUploadStopped))
|
||||
|
||||
Reference in New Issue
Block a user