lib/workless/scalers/local.rb in workless-0.2.0 vs lib/workless/scalers/local.rb in workless-1.0.0
- old
+ new
@@ -4,24 +4,24 @@
module Workless
module Scaler
class Local < Base
- def up
- Rush::Box.new[Rails.root].bash("rake jobs:work", :background => true) if workers == 0
+ def self.up
+ Rush::Box.new[Rails.root].bash("rake jobs:work", :background => true) if self.workers == 0
true
end
- def down
- Rush::Box.new.processes.filter(:cmdline => /rake jobs:work/).kill unless workers == 0 or jobs.count > 0
+ def self.down
+ $exit = true unless jobs.count > 0
true
end
- def workers
+ def self.workers
Rush::Box.new.processes.filter(:cmdline => /rake jobs:work/).size
end
end
end
end
-end
\ No newline at end of file
+end