Skip to content
Snippets Groups Projects
Commit 464477e6 authored by Arthur Ulfeldt's avatar Arthur Ulfeldt
Browse files

appease diligent linter

parent 0436c2f0
Branches
Tags
No related merge requests found
......@@ -163,7 +163,7 @@
;; now actively shut down the pool so that any open connections are closed
(.close ^ComboPooledDataSource (:datasource pool))
(when-let [ssh-tunnel (:ssh-tunnel pool)]
(.disconnect ssh-tunnel))))
(.disconnect ^com.jcraft.jsch.Session ssh-tunnel))))
(defn db->pooled-connection-spec
"Return a JDBC connection spec that includes a cp30 `ComboPooledDataSource`.
......
......@@ -11,8 +11,11 @@
assigned tunnel entrance port. It's the callers responsibility to call .disconnect
on the returned connection object."
[{:keys [tunnel-host tunnel-port tunnel-user tunnel-pass host port]}]
(let [connection (doto (.getSession (new com.jcraft.jsch.JSch) tunnel-user tunnel-host tunnel-port)
(.setPassword tunnel-pass)
(let [connection (doto ^com.jcraft.jsch.Session (.getSession (new com.jcraft.jsch.JSch)
^String tunnel-user
^String tunnel-host
^Int tunnel-port)
(.setPassword ^String tunnel-pass)
(.setConfig "StrictHostKeyChecking" "no")
(.connect default-ssh-timeout)
(.setPortForwardingL 0 host port))
......@@ -20,7 +23,7 @@
first
(string/split #":")
first
(Integer.))]
(Integer/parseInt))]
(assert (number? input-port))
(log/info (u/format-color 'cyan "creating ssh tunnel %s@%s:%s -L %s:%s:%s" tunnel-user tunnel-host tunnel-port input-port host port))
[connection input-port]))
......@@ -98,7 +101,7 @@
(catch Exception e
(throw e))
(finally
(.disconnect (:tunnel-connection details-with-tunnel))
(.disconnect ^com.jcraft.jsch.Session (:tunnel-connection details-with-tunnel))
(log/info (u/format-color 'cyan "<< CLOSED SSH TUNNEL >>")))))
(f details)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment