Module: Resque::Plugins::JobTracking
- Defined in:
- lib/resque/plugins/job_tracking.rb,
lib/resque/plugins/job_tracking/version.rb
Constant Summary collapse
- VERSION =
"0.0.4"
Class Method Summary collapse
- .extended(mod) ⇒ Object
- .failed_jobs(identifier) ⇒ Object
- .pending_jobs(identifier) ⇒ Object
- .running_jobs(identifier) ⇒ Object
Instance Method Summary collapse
- #around_perform_job_tracking(meta_id, *jobargs, &block) ⇒ Object
- #before_enqueue_job_tracking(meta_id, *jobargs) ⇒ Object
- #expire_failures_meta_in ⇒ Object
- #expire_normal_meta_in ⇒ Object
Class Method Details
.extended(mod) ⇒ Object
7 8 9 |
# File 'lib/resque/plugins/job_tracking.rb', line 7 def self.extended(mod) mod.extend(Resque::Plugins::Meta) end |
.failed_jobs(identifier) ⇒ Object
19 20 21 |
# File 'lib/resque/plugins/job_tracking.rb', line 19 def self.failed_jobs(identifier) Resque.redis.smembers("#{identifier}:failed") || [] end |
.pending_jobs(identifier) ⇒ Object
11 12 13 |
# File 'lib/resque/plugins/job_tracking.rb', line 11 def self.pending_jobs(identifier) Resque.redis.smembers("#{identifier}:pending") || [] end |
.running_jobs(identifier) ⇒ Object
15 16 17 |
# File 'lib/resque/plugins/job_tracking.rb', line 15 def self.running_jobs(identifier) Resque.redis.smembers("#{identifier}:running") || [] end |
Instance Method Details
#around_perform_job_tracking(meta_id, *jobargs, &block) ⇒ Object
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/resque/plugins/job_tracking.rb', line 40 def around_perform_job_tracking(, *, &block) if && self.respond_to?(:track) && = () then perform_with_job_tracking(, , *, &block) else yield end end |
#before_enqueue_job_tracking(meta_id, *jobargs) ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/resque/plugins/job_tracking.rb', line 31 def before_enqueue_job_tracking(, *) if && self.respond_to?(:track) && = () then enqueue_with_job_tracking(, , *) end end |
#expire_failures_meta_in ⇒ Object
27 28 29 |
# File 'lib/resque/plugins/job_tracking.rb', line 27 def + (24 * 60 * 60) end |
#expire_normal_meta_in ⇒ Object
23 24 25 |
# File 'lib/resque/plugins/job_tracking.rb', line 23 def end |