enhance: wip improve file watcher

This commit is contained in:
Tienson Qin
2021-05-17 00:50:42 +08:00
parent 23cc57e120
commit 82a4183102
2 changed files with 12 additions and 5 deletions

View File

@@ -21,9 +21,9 @@
(cond
(= "add" type)
(when-not (db/file-exists? repo path)
(let [_ (file-handler/alter-file repo path content {:re-render-root? true
:from-disk? true})]
(db/set-file-last-modified-at! repo path mtime)))
(let [_ (file-handler/alter-file repo path content {:re-render-root? true
:from-disk? true})]
(db/set-file-last-modified-at! repo path mtime)))
(and (= "change" type)
(not (db/file-exists? repo path)))