fix: slow re-index

This commit is contained in:
Tienson Qin
2022-06-06 14:35:07 +08:00
parent 4ff98966da
commit c3801d5aaf

View File

@@ -9,13 +9,12 @@
(defn invoke-hooks
[tx-report]
(let [{:keys [pages blocks]} (ds-report/get-blocks-and-pages tx-report)]
(when-not (:from-disk? (:tx-meta tx-report))
(doseq [p (seq pages)] (updated-page-hook tx-report p)))
(when (and state/lsp-enabled? (seq blocks))
(state/pub-event! [:plugin/hook-db-tx
{:blocks blocks
:tx-data (:tx-data tx-report)
:tx-meta (:tx-meta tx-report)}]))
;; TODO: Add blocks to hooks
#_(doseq [b (seq blocks)])))
(when (and (not (:from-disk? (:tx-meta tx-report)))
(not (:new-graph? (:tx-meta tx-report))))
(let [{:keys [pages blocks]} (ds-report/get-blocks-and-pages tx-report)]
(doseq [p (seq pages)] (updated-page-hook tx-report p))
(when (and state/lsp-enabled? (seq blocks))
(state/pub-event! [:plugin/hook-db-tx
{:blocks blocks
:tx-data (:tx-data tx-report)
:tx-meta (:tx-meta tx-report)}])))))