Skip to content

Commit

Permalink
refactor shutdown-agents handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Yogthos committed Sep 9, 2024
1 parent dd70b82 commit 7832cd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@

(defn stop-app []
((or (:stop defaults) (fn [])))
(some-> (deref system) (ig/halt!))
(shutdown-agents))
(some-> (deref system) (ig/halt!)))

(defn start-app [& [params]]
((or (:start params) (:start defaults) (fn [])))
(->> (config/system-config (or (:opts params) (:opts defaults) {}))
(ig/expand)
(ig/init)
(reset! system))
(.addShutdownHook (Runtime/getRuntime) (Thread. stop-app)))
(.addShutdownHook (Runtime/getRuntime) (Thread. stop-app))
(.addShutdownHook (Runtime/getRuntime) (shutdown-agents)))

(defn -main [& _]
(start-app))
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"kit-sql-hikari" "1.0.6"
"kit-sql" "1.1.4"
"kit-undertow" "1.0.7"
"lein-template" "0.1.66"
"deps-template" "0.1.66"}
"lein-template" "0.1.67"
"deps-template" "0.1.67"}

0 comments on commit 7832cd0

Please sign in to comment.