fix: don't run sync for local graphs that's detached from server

This commit is contained in:
Tienson Qin
2026-01-30 03:00:28 +08:00
parent 96e2be398f
commit e00a037624
6 changed files with 51 additions and 41 deletions

View File

@@ -147,10 +147,19 @@
coerced))
body))
(defn- graph-in-remote-list?
[repo]
(some #(= repo (:url %)) (state/get-rtc-graphs)))
(defn <rtc-start!
[repo & {:keys [_stop-before-start?] :as _opts}]
(log/info :db-sync/start {:repo repo})
(state/<invoke-db-worker :thread-api/db-sync-start repo))
(if (graph-in-remote-list? repo)
(do
(log/info :db-sync/start {:repo repo})
(state/<invoke-db-worker :thread-api/db-sync-start repo))
(do
(log/info :db-sync/skip-start {:repo repo :reason :graph-not-in-remote-list})
(p/resolved nil))))
(defn <rtc-stop!
[]