Class: Resque::Pertry::Purger
- Inherits:
-
Object
- Object
- Resque::Pertry::Purger
- Defined in:
- lib/resque/pertry/purger.rb
Class Attribute Summary collapse
- .failed_jobs_limit ⇒ Object
- .sleep_time ⇒ Object
-
.verbose ⇒ Object
Returns the value of attribute verbose.
Class Method Summary collapse
-
.after_database_purge(&block) ⇒ Object
allows an app to set a hook to deal with the failed persistence table job.
-
.after_redis_purge(&block) ⇒ Object
allows an app to set a hook to deal with the failed redis job.
-
.purge ⇒ Object
run a purge cycle.
-
.run ⇒ Object
main loop.
- .stats ⇒ Object
-
.status ⇒ Object
display status of failed queues and persistence table.
Class Attribute Details
.failed_jobs_limit ⇒ Object
19 20 21 |
# File 'lib/resque/pertry/purger.rb', line 19 def failed_jobs_limit @failed_jobs_limit ||= 100 end |
.sleep_time ⇒ Object
15 16 17 |
# File 'lib/resque/pertry/purger.rb', line 15 def sleep_time @sleep_time ||= 5.minutes end |
.verbose ⇒ Object
Returns the value of attribute verbose.
7 8 9 |
# File 'lib/resque/pertry/purger.rb', line 7 def verbose @verbose end |
Class Method Details
.after_database_purge(&block) ⇒ Object
allows an app to set a hook to deal with the failed persistence table job
58 59 60 |
# File 'lib/resque/pertry/purger.rb', line 58 def after_database_purge(&block) @after_database_purge = block end |
.after_redis_purge(&block) ⇒ Object
allows an app to set a hook to deal with the failed redis job
53 54 55 |
# File 'lib/resque/pertry/purger.rb', line 53 def after_redis_purge(&block) @after_redis_purge = block end |
.purge ⇒ Object
run a purge cycle
38 39 40 41 42 43 44 |
# File 'lib/resque/pertry/purger.rb', line 38 def purge procline("working") add_stat(:loops, 1) purge_resque purge_database end |
.run ⇒ Object
main loop
28 29 30 31 32 33 34 35 |
# File 'lib/resque/pertry/purger.rb', line 28 def run setup loop do purge wait end end |
.stats ⇒ Object
23 24 25 |
# File 'lib/resque/pertry/purger.rb', line 23 def stats @stats ||= {} end |
.status ⇒ Object
display status of failed queues and persistence table
47 48 49 50 |
# File 'lib/resque/pertry/purger.rb', line 47 def status show_config show_info end |