Perf/db serialization (#1417)

* perf: disable auto-save dbs on electron

We still save the dbs when user reload the app or close the app.

Notice: Ctrl-c doesn't work now

* chore: re-enable mtime check when writing to disk

* ui: add db persistent notification
This commit is contained in:
Tienson Qin
2021-03-08 16:31:58 +08:00
committed by GitHub
parent 00b0083546
commit 35296a6897
12 changed files with 142 additions and 76 deletions

View File

@@ -40,20 +40,9 @@
(> mtime last-modified-at)))
(let [_ (file-handler/alter-file repo path content {:re-render-root? true
:from-disk? true})]
:from-disk? true})]
(db/set-file-last-modified-at! repo path mtime))
;; (= "unlink" type)
;; (when-let [page-name (db/get-file-page path)]
;; (page-handler/delete!
;; page-name
;; (fn []
;; (notification/show! (str "Page " page-name " was deleted on disk.")
;; :success)
;; (when (= (state/get-current-page) page-name)
;; ;; redirect to home
;; (route-handler/redirect-to-home!)))))
(contains? #{"add" "change" "unlink"} type)
nil