mirthlab/heroku-resque-auto-scale — pull request #3 by vicentemundim (2012-09-17 14:26:28+00:00)
Title: Do not scale down workers if there are more than one working worker

When after_perform_scale_down is called it will always have at least one working worker, which is itself, but it may have more workers working.

We can't just scale down based on the number of pending jobs, because if multiple jobs are queued at the same time and we have this many number of workers, we may have many working jobs and no pending job, yet we can't kill those workers.

By checking if there are any working workers besides the job itself we prevent this from happening.