0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-12 07:41:43 -05:00

🐛 Fix unexpected exception on websocket handler.

This commit is contained in:
Andrey Antukh 2020-01-28 12:52:48 +01:00
parent 590b68aa29
commit 2f589a49e9

View file

@ -17,6 +17,7 @@
[uxbox.util.uuid :as uuid]
[uxbox.util.transit :as t]
[uxbox.util.blob :as blob]
[vertx.core :as vc]
[vertx.http :as vh]
[vertx.web :as vw]
[vertx.util :as vu]
@ -87,12 +88,12 @@
(defn handler
[{:keys [user] :as req}]
(letfn [(on-init [ws]
(let [vsm (::vw/execution-context req)
(let [ctx (vc/current-context)
fid (get-in req [:path-params :file-id])
ws (assoc ws
:user-id user
:file-id fid)
sem (start-eventbus-consumer! vsm ws fid)]
sem (start-eventbus-consumer! ctx ws fid)]
(handle-message ws {:type :connect})
(assoc ws ::sem sem)))