fix: search failed because of wrong timestamp format

This commit is contained in:
Tienson Qin
2021-01-28 22:40:38 +08:00
parent 1a353f131c
commit 1c53d8f316
4 changed files with 16 additions and 20 deletions

View File

@@ -16,8 +16,7 @@
[type {:keys [dir path content stat] :as payload}]
(when dir
(let [repo (config/get-local-repo dir)
{:keys [mtime]} stat
mtime (tc/to-long mtime)]
{:keys [mtime]} stat]
(cond
(= "add" type)
(let [db-content (db/get-file path)]
@@ -39,6 +38,7 @@
(not= content (db/get-file path))
(when-let [last-modified-at (db/get-file-last-modified-at repo path)]
(> mtime last-modified-at)))
(file-handler/alter-file repo path content {:re-render-root? true})
(= "unlink" type)