lib/workless/scalers/heroku.rb in workless_revived-1.2.4.2 vs lib/workless/scalers/heroku.rb in workless_revived-1.2.5

- old
+ new

@@ -1,27 +1,23 @@ require 'heroku-api' module Delayed module Workless module Scaler - class Heroku < Base - extend Delayed::Workless::Scaler::HerokuClient def self.up - client.put_workers(ENV['APP_NAME'], 1) if self.workers == 0 + client.put_workers(ENV['APP_NAME'], 1) if workers == 0 end def self.down - client.put_workers(ENV['APP_NAME'], 0) unless self.jobs.count > 0 or self.workers == 0 + client.put_workers(ENV['APP_NAME'], 0) unless jobs.count > 0 || workers == 0 end def self.workers - client.get_ps(ENV['APP_NAME']).body.count { |p| p["process"] =~ /worker\.\d?/ } + client.get_ps(ENV['APP_NAME']).body.count { |p| p['process'] =~ /worker\.\d?/ } end - end - end end end