fix(sync): use fs2

This commit is contained in:
Andelf
2023-03-22 01:09:14 +08:00
parent a555dac245
commit e803e2d576
2 changed files with 5 additions and 5 deletions

View File

@@ -1446,10 +1446,10 @@
(.-deleted? filetxn)
false
(.-updated? filetxn)
(let [path (relative-path filetxn)
(let [rpath (relative-path filetxn)
repo (state/get-current-repo)
file-path (config/get-file-path repo path)
content (<! (p->c (fs/read-file "" file-path)))]
repo-dir (config/get-repo-dir repo)
content (<! (p->c (fs/read-file repo-dir rpath)))]
(and (seq origin-db-content)
(or (nil? content)
(some :removed (diff/diff origin-db-content content))))))))
@@ -1545,7 +1545,7 @@
txn->db-content-vec (->> filetxns
(mapv
#(when (is-journals-or-pages? %)
[% (db/get-file repo (config/get-file-path repo (relative-path %)))]))
[% (db/get-file repo (relative-path %))]))
(remove nil?))]
(doseq [relative-p (map relative-path filetxns)]