Skip to content

Commit

Permalink
[mod] [Undertow adapter] [#409] Add default Ajax read timeout (@kajism)
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Mar 7, 2023
1 parent 8806e72 commit 728901a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/taoensso/sente/server_adapters/undertow.clj
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,18 @@

(defn get-sch-adapter
"Returns an Undertow ServerChanAdapter. Options:
:ajax-resp-timeout-ms ; Max msecs to wait for Ajax responses
:ajax-resp-timeout-val ; Value returned in case of above timeout"
:ajax-resp-timeout-ms ; Max msecs to wait for Ajax responses (default 60 secs)
:ajax-resp-timeout-val ; Value returned in case of above timeout
; (default `:undertow/ajax-resp-timeout`)"
([] (get-sch-adapter nil))
([{:as opts
:keys [ajax-resp-timeout-ms
ajax-resp-timeout-val]}]
(UndertowServerChanAdapter. opts)))
ajax-resp-timeout-val]

:or {ajax-resp-timeout-ms (* 60 1000)
ajax-resp-timeout-val :undertow/ajax-resp-timeout}}]

(UndertowServerChanAdapter.
(assoc opts
:ajax-resp-timeout-ms ajax-resp-timeout-ms
:ajax-resp-timeout-val ajax-resp-timeout-val))))

0 comments on commit 728901a

Please sign in to comment.