mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
enhance: address suggestions from gabriel and zhiyuan
This commit is contained in:
@@ -600,7 +600,7 @@
|
||||
:fn #(repo-handler/fix-broken-graph! (state/get-current-repo))}
|
||||
|
||||
:dev/gc-graph {:binding []
|
||||
:db-graph? true
|
||||
:inactive (not (state/developer-mode?))
|
||||
:fn #(repo-handler/gc-graph! (state/get-current-repo))}
|
||||
|
||||
:dev/replace-graph-with-db-file {:binding []
|
||||
|
||||
@@ -251,10 +251,10 @@
|
||||
(not (number? last-gc-at))
|
||||
(> (- (common-util/time-ms) last-gc-at) (* 7 24 3600 1000))) ; 1 week ago
|
||||
(prn :debug "gc current graph")
|
||||
(sqlite-gc/gc-kvs-table! sqlite-db)
|
||||
(doseq [db [sqlite-db client-ops-db]]
|
||||
(sqlite-gc/gc-kvs-table! db))
|
||||
(d/transact! datascript-conn [{:db/ident :logseq.kv/graph-last-gc-at
|
||||
:kv/value (common-util/time-ms)}])))
|
||||
(sqlite-gc/gc-kvs-table! client-ops-db))
|
||||
:kv/value (common-util/time-ms)}]))))
|
||||
|
||||
(defn- create-or-open-db!
|
||||
[repo {:keys [config import-type datoms] :as opts}]
|
||||
@@ -734,7 +734,8 @@
|
||||
(let [{:keys [db client-ops]} (get @*sqlite-conns repo)
|
||||
conn (get @*datascript-conns repo)]
|
||||
(when (and db conn)
|
||||
(gc-sqlite-dbs! db client-ops conn {:from-user? true}))))
|
||||
(gc-sqlite-dbs! db client-ops conn {:from-user? true})
|
||||
nil)))
|
||||
|
||||
(comment
|
||||
(def-thread-api :general/dangerousRemoveAllDbs
|
||||
|
||||
@@ -788,7 +788,7 @@
|
||||
:dev/replace-graph-with-db-file "(Dev) Replace graph with its db.sqlite file"
|
||||
:dev/validate-db "(Dev) Validate current graph"
|
||||
:dev/fix-broken-graph "Fix current broken graph"
|
||||
:dev/gc-graph "Garbage collect graph (remove unused data in SQLite)"
|
||||
:dev/gc-graph "(Dev) Garbage collect graph (remove unused data in SQLite)"
|
||||
:dev/rtc-stop "(Dev) RTC Stop"
|
||||
:dev/rtc-start "(Dev) RTC Start"
|
||||
:window/close "Close window"}}
|
||||
|
||||
Reference in New Issue
Block a user