Hi -

I'm rigging up my own auto-scaling solution for workers. My plan to
shut a worker down when it's not needed is to set $exit = true when
there are no jobs left for it to do. As you can see (https://
github.com/collectiveidea/delayed_job/blob/v2.1.3/lib/delayed/
worker.rb#L74-92) this will simply end the "rake jobs:work" task just
as if I had (for example) hit Ctrl+C.

My question is, will Heroku recognize that the worker process has
ended and stop charging my account when this happens? Or do I have to
actually hit the Heroku API to shut it down? I'd prefer to use $exit
if possible, since that will ensure that the current worker (the one
with no jobs available) shuts down, whereas if I tell the Heroku API
to decrement my worker count by 1, and I have multiple workers
running, it could kill one of the other ones mid-job.

Thanks!
Chris

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.

Reply via email to