module Nucleus::Adapters::V1::Heroku::Scaling

Public Instance Methods

scale(application_id, instances) click to toggle source

@see Stub#scale

# File lib/nucleus/adapters/v1/heroku/scaling.rb, line 7
def scale(application_id, instances)
  scale_web(application_id, instances)
  # return the updated application object
  application(application_id)
end

Private Instance Methods

scale_web(application_id, instances) click to toggle source
# File lib/nucleus/adapters/v1/heroku/scaling.rb, line 15
def scale_web(application_id, instances)
  patch("/apps/#{application_id}/formation", body: { updates: [{ process: 'web', quantity: instances }] })
end
scale_worker(application_id, instances) click to toggle source
# File lib/nucleus/adapters/v1/heroku/scaling.rb, line 19
def scale_worker(application_id, instances)
  patch("/apps/#{application_id}/formation", body: { updates: [{ process: 'worker', quantity: instances }] },
        # raises 404 if no worker is defined in the Procfile
        expects: [404])
end