Created
April 10, 2015 02:47
-
-
Save Atalanta/0f505376539891a5124e 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
begin | |
users_queue.subscribe(:manual_ack => true, :block => true) do |delivery_info, properties, body| | |
sf, wm, em = *JSON.parse(body) | |
p [sf, wm , em] | |
urls = get_urls(sf, wm, em) | |
urls.each do |url| | |
url_queue.publish(url.to_json) | |
end | |
puts " [x] Queued #{urls.size} urls for #{em}" | |
users_channel.ack(delivery_info.delivery_tag) | |
count += 1 | |
raise Interrupt, "Restart me" if count > 200 | |
end | |
rescue Interrupt => _ | |
conn.close | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment