fix: import

This commit is contained in:
Tienson Qin
2026-01-08 18:10:03 +08:00
parent e89fdb92b6
commit fc4351c716
3 changed files with 20 additions and 17 deletions

View File

@@ -131,6 +131,11 @@
:$addresses addresses})
rows))
(defn- enable-sqlite-wal-mode!
[^Object db]
(.exec db "PRAGMA locking_mode=exclusive")
(.exec db "PRAGMA journal_mode=WAL"))
(defn- ensure-worker-sync-import-db!
[repo reset?]
(p/let [^js pool (<get-opfs-pool repo)
@@ -241,11 +246,6 @@
debug-log-db (new (.-OpfsSAHPoolDb pool) (str "debug-log" repo-path))]
[db search-db client-ops-db debug-log-db])))
(defn- enable-sqlite-wal-mode!
[^Object db]
(.exec db "PRAGMA locking_mode=exclusive")
(.exec db "PRAGMA journal_mode=WAL"))
(defn- gc-sqlite-dbs!
"Gc main db weekly and rtc ops db each time when opening it"
[sqlite-db client-ops-db debug-log-db datascript-conn {:keys [full-gc?]}]
@@ -263,7 +263,7 @@
:kv/value (common-util/time-ms)}]))))
(defn- <create-or-open-db!
[repo {:keys [config datoms worker-sync-download-graph?] :as opts}]
[repo {:keys [config datoms] :as opts}]
(when-not (worker-state/get-sqlite-conn repo)
(p/let [[db search-db client-ops-db debug-log-db :as dbs] (get-dbs repo)
storage (new-sqlite-storage db)