Add timeout exception
This commit is contained in:
parent
058230c9d3
commit
28dac9ad47
@ -15,8 +15,12 @@
|
|||||||
(defn wordpress?
|
(defn wordpress?
|
||||||
"Check if a web page is generated with WordPress"
|
"Check if a web page is generated with WordPress"
|
||||||
[url]
|
[url]
|
||||||
|
(try
|
||||||
(let [response (client/get (str "http://" url "/") {:ignore-unknown-host? true, :connection-timeout 5000, :throw-exceptions false})]
|
(let [response (client/get (str "http://" url "/") {:ignore-unknown-host? true, :connection-timeout 5000, :throw-exceptions false})]
|
||||||
(every? identity [(re-find (re-pattern "meta.*generator.*WordPress") (:body response))])))
|
(every? identity [(re-find (re-pattern "meta.*generator.*WordPress") (:body response))]))
|
||||||
|
(catch Exception e
|
||||||
|
"timeout"
|
||||||
|
)))
|
||||||
|
|
||||||
(defn -main
|
(defn -main
|
||||||
[& args]
|
[& args]
|
||||||
|
Loading…
Reference in New Issue
Block a user