Class: Resque::Plugins::Stages::Cleaner
- Inherits:
-
Object
- Object
- Resque::Plugins::Stages::Cleaner
- Includes:
- RedisAccess
- Defined in:
- lib/resque/plugins/stages/cleaner.rb
Overview
A class for cleaning up stranded objects for the Stages plugin
Constant Summary
Constants included from RedisAccess
Class Method Summary collapse
Methods included from RedisAccess
Class Method Details
.cleanup_jobs ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/resque/plugins/stages/cleaner.rb', line 23 def cleanup_jobs jobs = redis.keys("StagedJob::*") jobs.each do |job_key| job = Resque::Plugins::Stages::StagedJob.new(job_key[11..]) job.verify end end |
.purge_all ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/resque/plugins/stages/cleaner.rb', line 15 def purge_all keys = redis.keys("*") return if keys.blank? redis.del(*keys) end |