Created
December 10, 2010 18:37
-
-
Save jaydonnell/736583 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn send-url [url] | |
(try | |
(let [ip (ru/ip-address (get-domain url))] | |
(log/debug (str "SENDING URL: " url)) | |
(if (@fetchers ip) | |
(send-off (@fetchers ip) | |
handle-url | |
url) | |
(do | |
(add-fetcher ip) | |
(send-off (@fetchers ip) | |
handle-url | |
url)))) | |
(catch Exception e (log/debug (str "error sending url: " url) e)))) | |
(def consumer (agent 0 :error-handler (fn [a e] | |
(log/debug (str "consumer error: " e) e)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment