Module: HerokuResqueAutoScale::Scaler

Defined in:
lib/heroku-resque-auto-scale.rb

Constant Summary collapse

@@heroku =
Heroku::Client.new(ENV['HEROKU_USER'], ENV['HEROKU_PASSWORD'])

Class Method Summary collapse

Class Method Details

.job_countObject



16
17
18
# File 'lib/heroku-resque-auto-scale.rb', line 16

def job_count
  Resque.info[:pending].to_i
end

.workersObject



8
9
10
# File 'lib/heroku-resque-auto-scale.rb', line 8

def workers
  @@heroku.info(ENV['HEROKU_APP'])[:workers].to_i
end

.workers=(qty) ⇒ Object



12
13
14
# File 'lib/heroku-resque-auto-scale.rb', line 12

def workers=(qty)
  @@heroku.set_workers(ENV['HEROKU_APP'], qty)
end