Created
June 4, 2013 00:10
-
-
Save SocalNick/5702575 to your computer and use it in GitHub Desktop.
Clockwork + IronMQ
This file contains 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
require 'clockwork' | |
require 'iron_mq' | |
module Clockwork | |
configure do |cofig| | |
config[:tz] = "America/Los_Angeles" | |
end | |
handler do |job| | |
ironmq = IronMQ::Client.new | |
queue = ironmq.queue("query-stat-provider") | |
queue.post(job) | |
end | |
every(5.seconds, '{"type":"clock","function":"getInprogressEvents"}') | |
every(1.minutes, '{"type":"clock","function":"getUpcomingEvents"}') | |
every(15.minutes, '{"type":"clock","function":"getUberUpdate"}') | |
every(1.day, '{"type":"clock","function":"getDaily"}', :at => '00:00') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you could init this way
Then remove line #11