Skip to content

Commit 6b9ff71

Browse files
committed
perf: add PRAGMA jounal_mode&locking_mode to sqlite-dbs
1 parent 9c3381d commit 6b9ff71

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/main/frontend/worker/db_worker.cljs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,9 @@
302302
:search search-db
303303
:client-ops client-ops-db})
304304
(.exec db "PRAGMA locking_mode=exclusive")
305+
(.exec db "PRAGMA journal_mode=WAL")
306+
(.exec client-ops-db "PRAGMA locking_mode=exclusive")
307+
(.exec client-ops-db "PRAGMA journal_mode=WAL")
305308
(sqlite-common-db/create-kvs-table! db)
306309
(when-not @*publishing? (sqlite-common-db/create-kvs-table! client-ops-db))
307310
(db-migrate/migrate-sqlite-db db)
@@ -321,10 +324,10 @@
321324
(d/transact! conn initial-data {:initial-db? true})))
322325

323326
(when-not db-based?
324-
(try
325-
(when-not (ldb/page-exists? @conn common-config/views-page-name "page")
326-
(ldb/transact! conn (sqlite-create-graph/build-initial-views)))
327-
(catch :default _e)))
327+
(try
328+
(when-not (ldb/page-exists? @conn common-config/views-page-name "page")
329+
(ldb/transact! conn (sqlite-create-graph/build-initial-views)))
330+
(catch :default _e)))
328331

329332
;; (gc-kvs-table! db)
330333
(try

0 commit comments

Comments
 (0)