fix: no need to load db from disk since data is written directly

This commit is contained in:
Tienson Qin
2026-04-29 23:25:16 +08:00
parent 72252e5b58
commit 40d8442180
2 changed files with 2 additions and 6 deletions

View File

@@ -214,11 +214,7 @@
(state/<invoke-db-worker :thread-api/release-access-handles repo))
(<fetch-initial-data [_this repo opts]
(-> (p/let [db-exists? (state/<invoke-db-worker :thread-api/db-exists repo)
disk-db-data (when-not db-exists? (ipc/ipc :db-get repo))
_ (when disk-db-data
(state/<invoke-db-worker-direct-pass :thread-api/import-db repo disk-db-data))
_ (state/<invoke-db-worker :thread-api/create-or-open-db repo opts)]
(-> (p/let [_ (state/<invoke-db-worker :thread-api/create-or-open-db repo opts)]
(state/<invoke-db-worker :thread-api/get-initial-data repo opts))
(p/catch sqlite-error-handler)))

View File

@@ -896,7 +896,7 @@
backup-db-fn (get-in (platform/current) [:sqlite :backup-db])]
(when-not db
(throw (ex-info "graph not opened" {:code :graph-not-opened
:repo repo})))
:repo repo})))
(when-not (fn? backup-db-fn)
(throw (ex-info "platform sqlite backup not supported"
{:code :backup-not-supported