Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

more fixes

  • Loading branch information...
commit 4d875dc31d3091fd0f8f32f7d1ec37d1f6baf9ef 1 parent 92a5ce3
@sd authored
Showing with 3 additions and 6 deletions.
  1. +3 −6 lib/delayed/manager/heroku_cedar.rb
View
9 lib/delayed/manager/heroku_cedar.rb
@@ -6,24 +6,21 @@ class HerokuCedar
def initialize(options={})
username = options[:username] || ENV['HEROKU_USERNAME']
password = options[:password] || ENV['HEROKU_PASSWORD']
+ @max_scale = options[:max_workers] || ENV['DJ_MAX_WORKERS'] || 10
@app = options[:app] || ENV['HEROKU_APP']
@client = ::Heroku::Client.new(username, password)
end
- def max_scale
- options[:max_scale] || ENV['DJ_MAX'] || 10
- end
-
def qty
@client.ps(@app).select {|p| p["process"] =~ /^worker\./ and p["state"] == "up"}.size
end
def scale_up
- @client.ps_scale(@app, :type => "worker", :qty => [self.qty + 1, max_scale].min)
+ @client.ps_scale(@app, :type => "worker", :qty => [self.qty + 1, @max_scale].min)
end
def scale_down
- @client.ps_scale(@app, :type => "worker", :qty => [self.qty - 1, 0].ax)
+ @client.ps_scale(@app, :type => "worker", :qty => [self.qty - 1, 0].max)
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.