From 2f589a49e97bc5b2b352457d34f14fefbdeeeea3 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 28 Jan 2020 12:52:48 +0100 Subject: [PATCH] :bug: Fix unexpected exception on websocket handler. --- backend/src/uxbox/http/ws.clj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/src/uxbox/http/ws.clj b/backend/src/uxbox/http/ws.clj index 1ccc60e60..76dd43cb3 100644 --- a/backend/src/uxbox/http/ws.clj +++ b/backend/src/uxbox/http/ws.clj @@ -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)))