Skip to content

Commit

Permalink
fix: return true with async handler
Browse files Browse the repository at this point in the history
  • Loading branch information
sunng87 committed Sep 6, 2024
1 parent 6f1ceda commit 8bc5d42
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions src/ring/adapter/jetty9/handlers/async.clj
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,20 @@
^Request request
^Response response
^Callback callback]
(try
(let [[handler options] (.state this)
;;TODO: async timeout
;; async-timeout (:async-timeout options 30000)
]
(handler
(common/build-request-map request)
(fn [response-map]
(let [response-map (common/normalize-response response-map)]
(if (common/websocket-upgrade-response? response-map)
(ws/upgrade-websocket request response callback response-map)
(common/update-response request response response-map)))
(.succeeded callback))
(fn [^Throwable exception]
(Response/writeError request response callback exception)
(.failed callback exception))))
(finally
true)))
(let [[handler options] (.state this)
;;TODO: async timeout
;; async-timeout (:async-timeout options 30000)
]
(handler
(common/build-request-map request)
(fn [response-map]
(let [response-map (common/normalize-response response-map)]
(if (common/websocket-upgrade-response? response-map)
(ws/upgrade-websocket request response callback response-map)
(common/update-response request response response-map)))
(.succeeded callback))
(fn [^Throwable exception]
(Response/writeError request response callback exception)
(.failed callback exception))))

true)

0 comments on commit 8bc5d42

Please sign in to comment.