Rake tasks for scaling ruby apps in Heroku (non-rails)?

I’m currently running a ruby app with:

heroku scale web=0
heroku scale worker=1

I’d like to write a rake task that will run:

heroku scale worker=0

I’m thinking of something akin to:

task :scale_down => :environment do
  heroku = Heroku::API.new
  heroku.post_ps_scale('worker', 0)
end

but one problem is that my app doesn’t have an environment since it’s not a rails app. Is there a simple rake task that I can use to scale my worker to 0? Thanks!


Source: ruby

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.