Skip to content

Commit e8f119a

Browse files
authored
Merge pull request #8498 from NBKelly/ws-kalive
set ws keepalive to 5 seconds
2 parents 615aa7f + 9e19a2d commit e8f119a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/clj/web/ws.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919

2020
(let [chsk-server (sente/make-channel-socket-server!
2121
(get-sch-adapter)
22-
{:user-id-fn (fn [ring-req]
22+
{:ws-kalive-ms 2500
23+
:user-id-fn (fn [ring-req]
2324
(or (-> ring-req :session :uid)
2425
(:client-id ring-req)))})
2526
{:keys [ch-recv send-fn connected-uids

src/cljs/nr/ws.cljs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"/chsk"
1717
?csrf-token
1818
{:type (if (get-in @app-state [:options :disable-websockets]) :ajax :auto)
19+
:ws-kalive-ms 2500 ;; note - supposedly this will help SEA/LATAM connections
1920
:wrap-recv-evs? false})]
2021
(def chsk chsk)
2122
(def ch-chsk ch-recv)

0 commit comments

Comments
 (0)