Created
February 20, 2014 22:44
-
-
Save cap10morgan/9124854 to your computer and use it in GitHub Desktop.
Graceful Jetty shutdown in pedestal-service 0.2.x
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns myapp.service | |
(:require [io.pedestal.service.http :as bootstrap])) | |
(defn jetty-configurator [server] | |
(let [one-minute 60000] | |
(.setGracefulShutdown server one-minute) | |
(.setStopAtShutdown server true)) | |
server) | |
(defn service [] | |
{:env :prod | |
::bootstrap/routes routes | |
::bootstrap/resource-path "/public" | |
::bootstrap/host "0.0.0.0" | |
::bootstrap/type :jetty | |
::bootstrap/jetty-options {:configurator jetty-configurator} ; <- this sets the fn above as the Jetty configurator | |
::bootstrap/port 80}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment