Skip to content

Commit 348c9d2

Browse files
committed
Avoid server stuck during initialize due to threads unavailable
1 parent da360eb commit 348c9d2

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
- Fix clear messages to reset last api used as well.
6+
- Avoid server stuck during initialize due to threads unavailable.
67

78
## 0.109.3
89

src/eca/handlers.clj

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
messenger
9393
db*)))))))]
9494
(swap! db* assoc-in [:config-updated-fns :sync-models] #(sync-models-and-notify! %))
95-
(sync-models-and-notify! config)))
95+
(future (sync-models-and-notify! config))))
9696
(future
9797
(Thread/sleep 1000) ;; wait chat window is open in some editors.
9898
(when-let [error (config/validation-error)]
@@ -108,11 +108,12 @@
108108
(future
109109
(cache/cleanup-tool-call-outputs!))
110110
;; Trigger sessionStart hook after initialization
111-
(f.hooks/trigger-if-matches! :sessionStart
112-
(f.hooks/base-hook-data @db*)
113-
{}
114-
@db*
115-
config))
111+
(future
112+
(f.hooks/trigger-if-matches! :sessionStart
113+
(f.hooks/base-hook-data @db*)
114+
{}
115+
@db*
116+
config)))
116117

117118
(defn workspace-did-change-folders [{:keys [db*]} params]
118119
(let [{:keys [added removed]} (:event params)

0 commit comments

Comments
 (0)