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
23 24 25 26 27 28 |
# File 'lib/workless/scalers/local.rb', line 23 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
7 8 9 10 11 12 13 |
# File 'lib/workless/scalers/local.rb', line 7 def self.executable_prefix if defined? Delayed::Compatibility.executable_prefix Delayed::Compatibility.executable_prefix else 'script' end end |
.up ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/workless/scalers/local.rb', line 15 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
30 31 32 |
# File 'lib/workless/scalers/local.rb', line 30 def self.workers Rush::Box.new.processes.filter(cmdline: /delayed_job start -i workless|delayed_job.workless/).size end |