lib/workless/scalers/heroku_cedar.rb in rcarvalho-workless-1.0.2.7 vs lib/workless/scalers/heroku_cedar.rb in rcarvalho-workless-1.0.2.8

- old
+ new

@@ -7,10 +7,11 @@ class HerokuCedar < Base extend Delayed::Workless::Scaler::HerokuClient def self.up + @@current_num_workers || 0 nw = self.calculate_num_workers if nw if @@current_num_workers != nw @@current_num_workers = nw client.ps_scale(ENV['APP_NAME'], :type => 'worker', :qty => @@current_num_workers) @@ -18,10 +19,11 @@ end rescue end def self.down + @@current_num_workers || 0 nw = self.calculate_num_workers if nw if @@current_num_workers != nw @@current_num_workers = nw client.ps_scale(ENV['APP_NAME'], :type => 'worker', :qty => nw) @@ -29,9 +31,10 @@ end rescue end def self.workers + @@current_num_workers || 0 @@current_num_workers || client.ps(ENV['APP_NAME']).count { |p| p["process"] =~ /worker\.\d?/ } end end