lib/qpush/server/apis/delay.rb in qpush-0.1.4 vs lib/qpush/server/apis/delay.rb in qpush-0.1.6

- old
+ new

@@ -1,8 +1,10 @@ module QPush module Server module Apis + # The Delay API will take a job and add it to the delay sorted set. + # class Delay < Base def initialize(job, type) @job = job @type = type end @@ -13,12 +15,12 @@ end private def delay_job - QPush.redis.with do |conn| - conn.hincrby(QPush.keys.stats, @stat, 1) - conn.zadd(QPush.keys.delay, @time, @job.to_json) + Server.redis do |conn| + conn.hincrby(Server.keys.stats, @stat, 1) + conn.zadd(Server.keys.delay, @time, @job.to_json) end end def load_type case @type