mirror of https://github.com/status-im/timbre.git
[#146] Fix executor type ambiguity with Clojure 1.6?
Having difficulty reproducing the error described by the GitHub issue. Figure the cause might have something to do with attaching the type info to the (fn []) form? The approach as of this commit seems like it'd be less likely to trip up the compiler.
This commit is contained in:
parent
d08b0bd174
commit
8271ba9a0b
|
@ -565,14 +565,14 @@
|
||||||
;; that starts the Clojure agent threadpool which can slow application
|
;; that starts the Clojure agent threadpool which can slow application
|
||||||
;; shutdown w/o a `(shutdown-agents)` call
|
;; shutdown w/o a `(shutdown-agents)` call
|
||||||
(let [executor (java.util.concurrent.Executors/newSingleThreadExecutor)
|
(let [executor (java.util.concurrent.Executors/newSingleThreadExecutor)
|
||||||
f_ (.submit executor ^java.util.concurrent.Callable
|
^java.util.concurrent.Callable f
|
||||||
(fn []
|
(fn []
|
||||||
(try
|
(try
|
||||||
(.. java.net.InetAddress getLocalHost getHostName)
|
(.. java.net.InetAddress getLocalHost getHostName)
|
||||||
(catch java.net.UnknownHostException _ "UnknownHost")
|
(catch java.net.UnknownHostException _ "UnknownHost")
|
||||||
(finally (.shutdown executor)))))]
|
(finally (.shutdown executor))))]
|
||||||
|
|
||||||
(deref f_ 5000 "UnknownHost")))))
|
(deref (.submit executor f) 5000 "UnknownHost")))))
|
||||||
|
|
||||||
(comment (get-hostname))
|
(comment (get-hostname))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue