Class: Delayed::Workless::Scaler::Local
- Defined in:
- lib/workless/scalers/local.rb
Class Method Summary collapse
Methods inherited from Base
Class Method Details
.down ⇒ Object
25 26 27 28 29 30 |
# File 'lib/workless/scalers/local.rb', line 25 def self.down if workers > 0 && jobs.count == 0 Rush::Box.new[Rails.root].bash("#{executable_prefix}/delayed_job stop -i workless", background: true) end true end |
.executable_prefix ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/workless/scalers/local.rb', line 9 def self.executable_prefix if defined? Delayed::Compatibility.executable_prefix Delayed::Compatibility.executable_prefix else 'script' end end |
.up ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/workless/scalers/local.rb', line 17 def self.up if workers == 0 Rush::Box.new[Rails.root].bash("#{executable_prefix}/delayed_job start -i workless", background: true) sleep 1 end true end |
.workers ⇒ Object
32 33 34 |
# File 'lib/workless/scalers/local.rb', line 32 def self.workers Rush::Box.new.processes.filter(cmdline: /delayed_job start -i workless|delayed_job.workless/).size end |