浏览代码

fix: delay building search indice

Tienson Qin 1 月之前
父节点
当前提交
d7b4d61e19
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      src/main/frontend/handler/events.cljs

+ 5 - 2
src/main/frontend/handler/events.cljs

@@ -76,8 +76,11 @@
    (graph-switch graph)
    (graph-switch graph)
    (state/set-state! :sync-graph/init? false)
    (state/set-state! :sync-graph/init? false)
    (when (:rtc-download? opts)
    (when (:rtc-download? opts)
-     (and (search-handler/rebuild-indices!) true)
-     (repo-handler/refresh-repos!))))
+     (repo-handler/refresh-repos!)
+     (p/do!
+      (p/delay 5000)
+      ;; TODO: search should be lazy computed
+      (search-handler/rebuild-indices!)))))
 
 
 (defmethod handle :graph/switch [[_ graph opts]]
 (defmethod handle :graph/switch [[_ graph opts]]
   (let [switch-promise
   (let [switch-promise