lib/qpush/server/delay.rb in qpush-0.1.7 vs lib/qpush/server/delay.rb in qpush-0.1.8

- old
+ new

@@ -32,19 +32,19 @@ # Retrieves delayed jobs based on the time they should be performed. # If any are found, begin to update them. # def retrieve_delays - delays = @conn.zrangebyscore(Server.keys.delay, 0, Time.now.to_i) + delays = @conn.zrangebyscore(Server.keys[:delay], 0, Time.now.to_i) delays.any? ? update_delays(delays) : @conn.unwatch end # Removes jobs that have been retrieved and sets them up to be performed. # def update_delays(delays) @conn.multi do |multi| - multi.zrem(Server.keys.delay, delays) + multi.zrem(Server.keys[:delay], delays) delays.each { |job| perform_job(job) } end end # Add a delayed job to the appropriate perform list. @@ -57,10 +57,10 @@ end # Performs a watch on our delay list # def watch_delay - @conn.watch(Server.keys.delay) do + @conn.watch(Server.keys[:delay]) do yield if block_given? end end end end