mirror of https://github.com/status-im/timbre.git
`get-hostname`: remove unnecessary promise, add max blocking time
This commit is contained in:
parent
2cc45e82bf
commit
160102c5d8
|
@ -250,13 +250,12 @@
|
||||||
(def ^:private get-hostname
|
(def ^:private get-hostname
|
||||||
(encore/memoize* 60000
|
(encore/memoize* 60000
|
||||||
(fn []
|
(fn []
|
||||||
(let [p (promise)]
|
(->
|
||||||
(future ; Android doesn't like this on the main thread
|
(future ; Android doesn't like this on the main thread
|
||||||
(deliver p
|
|
||||||
(try (.. java.net.InetAddress getLocalHost getHostName)
|
(try (.. java.net.InetAddress getLocalHost getHostName)
|
||||||
(catch java.net.UnknownHostException _
|
(catch java.net.UnknownHostException _
|
||||||
"UnknownHost"))))
|
"UnknownHost")))
|
||||||
@p))))
|
(deref 5000 "UnknownHost")))))
|
||||||
|
|
||||||
(defn- wrap-appender-juxt
|
(defn- wrap-appender-juxt
|
||||||
"Wraps compile-time appender juxt with additional runtime capabilities
|
"Wraps compile-time appender juxt with additional runtime capabilities
|
||||||
|
|
Loading…
Reference in New Issue