Skip to content

Commit ba94464

Browse files
author
Paula Gearon
committed
Added shudown cleanup for the JVM
1 parent f1cff26 commit ba94464

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/asami/core.cljc

+8
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919

2020
(defonce connections (atom {}))
2121

22+
(defn shutdown
23+
"Releases all connection resources for a clean shutdown"
24+
[]
25+
(doseq [connection (vals @connections)] (storage/release connection)))
26+
27+
#?(:clj
28+
(.addShutdownHook (Runtime/getRuntime) (Thread. shutdown)))
29+
2230
(s/defn ^:private parse-uri :- {:type s/Str
2331
:name s/Str}
2432
"Splits up a database URI string into structured parts"

0 commit comments

Comments
 (0)