enhance: backup db file when not matched

pull/5576/head
Tienson Qin 2022-06-06 18:33:37 +08:00
parent 781062a4ce
commit b025ce71d2
1 changed files with 2 additions and 0 deletions

View File

@ -69,6 +69,8 @@
(->
(p/let [result (ipc/ipc "writeFile" repo path content)
mtime (gobj/get result "mtime")]
(when-not contents-matched?
(ipc/ipc "backupDbFile" (config/get-local-dir repo) path db-content content))
(db/set-file-last-modified-at! repo path mtime)
(p/let [content (if (encrypt/encrypted-db? (state/get-current-repo))
(encrypt/decrypt content)