0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 08:50:57 -05:00

🐛 Fix incorrect order of update-index operations

This commit is contained in:
Andrey Antukh 2024-06-10 15:13:19 +02:00 committed by Alonso Torres
parent edfc47d3de
commit b635427f91

View file

@ -205,15 +205,21 @@
(update-status :pending)))
(rx/take-until stoper-s))
(->> commits-s
(rx/buffer-time 200)
(rx/mapcat merge-commit)
(rx/map dch/update-indexes)
(rx/take-until stoper-s)
(rx/finalize (fn []
(log/debug :hint "finalize persistence: changes watcher [index]"))))
;; Here we watch for local commits, buffer them in a small
;; chunks (very near in time commits) and append them to the
;; persistence queue
(->> commits-s
(rx/buffer-until notifier-s)
(rx/mapcat merge-commit)
(rx/mapcat (fn [commit]
(rx/of (append-commit commit)
(dch/update-indexes commit))))
(rx/map append-commit)
(rx/take-until (rx/delay 100 stoper-s))
(rx/finalize (fn []
(log/debug :hint "finalize persistence: changes watcher"))))