Class: SidekiqHerokuScaler::Manager

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq-heroku-scaler/manager.rb

Instance Method Summary collapse

Constructor Details

#initialize(heroku_app_name:, heroku_token:, workers:, strategy:) ⇒ Manager

Returns a new instance of Manager.



8
9
10
11
12
# File 'lib/sidekiq-heroku-scaler/manager.rb', line 8

def initialize(heroku_app_name:, heroku_token:, workers:, strategy:)
  @heroku_client = SidekiqHerokuScaler::Heroku::Client.new(heroku_app_name, heroku_token)
  @strategy = strategy
  @workers = workers
end

Instance Method Details

#performObject



14
15
16
17
18
# File 'lib/sidekiq-heroku-scaler/manager.rb', line 14

def perform
  autoscalable_workers.each do |worker_name|
    autoscale_one(worker_name)
  end
end