Skip to content

Instantly share code, notes, and snippets.

@jorinvo
Created June 18, 2023 10:10
Show Gist options
  • Save jorinvo/c3b2117dac3b2981f88fd029fec93220 to your computer and use it in GitHub Desktop.
Save jorinvo/c3b2117dac3b2981f88fd029fec93220 to your computer and use it in GitHub Desktop.
Handle system signals in Clojure
;; 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