Refactor: use last modified time to decide if file has been changed

Previously, we're using file content.

Fixes LOG-3161
This commit is contained in:
Tienson Qin
2024-06-16 10:59:12 +08:00
parent 8c88f16a75
commit 96be194de5
6 changed files with 92 additions and 118 deletions

View File

@@ -86,8 +86,7 @@
(when (and repo path last-modified-at)
(transact! repo
[{:file/path path
:file/last-modified-at last-modified-at}]
{:skip-refresh? true})))
:file/last-modified-at last-modified-at}] {})))
(defn set-file-content!
([repo path content]
@@ -96,4 +95,4 @@
(when (and repo path)
(let [tx-data {:file/path path
:file/content content}]
(transact! repo [tx-data] (merge opts {:skip-refresh? true}))))))
(transact! repo [tx-data] opts)))))