Skip to content

Commit

Permalink
call create queue until it succeeds
Browse files Browse the repository at this point in the history
  • Loading branch information
hiredman committed Jul 24, 2011
1 parent 0679e20 commit 6a66199
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Howler/core.clj
Expand Up @@ -32,7 +32,16 @@
(secure? [acct] (:secure? acct false)))

(defn connect-to-queue [account queue-name]
(.getOrCreateMessageQueue (queue-service account) queue-name))
(letfn [(f []
(try
(.getOrCreateMessageQueue (queue-service account) queue-name)
(catch Exception e
(.printStackTrace e)
(Thread/sleep 1000))))]
(loop [x nil]
(if-not x
(recur (f))
x))))

(defmulti -main (fn [x & _] x))

Expand Down Expand Up @@ -129,6 +138,8 @@
(first (shuffle i))
i))))

;;

(defn add-icon [x m]
((if-let [icon (icon (:recipient m))]
#(assoc % :image icon)
Expand Down

0 comments on commit 6a66199

Please sign in to comment.