Created
June 18, 2023 10:10
-
-
Save jorinvo/c3b2117dac3b2981f88fd029fec93220 to your computer and use it in GitHub Desktop.
Handle system signals in Clojure
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
;; This uses https://github.com/pyr/signal | |
(signal/with-handler :term | |
(log/info "caught SIGTERM, quitting") | |
(stop) | |
(System/exit 0)) | |
(signal/with-handler :hup | |
(log/info "caught SIGHUP, reloading") | |
(stop) | |
(start)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment