lib/qpush/server/apis/success.rb in qpush-0.1.4 vs lib/qpush/server/apis/success.rb in qpush-0.1.6
- old
+ new
@@ -1,13 +1,9 @@
module QPush
module Server
module Apis
class Success < Base
- def initialize(job)
- @job = job
- end
-
def call
update_job
stat_increment
log_success
update_history
@@ -19,16 +15,16 @@
@job.mark_success
@job.delay if @job.delay_job?
end
def stat_increment
- QPush.redis.with do |c|
- c.hincrby(QPush.keys.stats, 'success', 1)
+ Server.redis do |c|
+ c.hincrby(Server.keys.stats, 'success', 1)
end
end
def log_success
- Server.log.info("Job SUCCESS | #{@job.klass} with ID: #{@job.id} | #{@job.run_time}")
+ Server.log.info("Worker #{Server.worker.id} | Job SUCCESS | #{@job.klass} with ID: #{@job.id} | #{@job.run_time}")
end
def update_history
History.call(@job, true, nil)
end