Testing an app on the Cedar stack, seems like the worker only starts after a second job is added to the queue, both setting the MIN/MAX/RATIO configs and not. Is this the expected behavior?
Also: local works fine.
Browsing the code, I think that maybe the issue was introduced here: https://github.com/lostboy/workless/blob/3767b3d4c06973a96d6f00b7e7461bb7ab9ce07e/lib/workless/scalers/heroku_cedar.rb
client.ps_scale(ENV['APP_NAME'], :type => 'worker', :qty => 1) if self.workers == 0
client.ps_scale(ENV['APP_NAME'], :type => 'worker', :qty => self.workers_needed) if self.workers < self.workers_needed
I might be wrong, but my guess is that self.workers_needed returns '0' the first time around becuase it's hooked before the insertion is made, so self.jobs.count is still 0 at that point.
Looks like you've nailed it, @fixr!
@lostboy, I've checked my patch on Heroku, seems to be working as expected. Could you merge and release? Thanks!
@filiptepper , @fixr so it should be reverted to the original 'before' state? do you want to submit a pr so i don't bodge it?
spawn workers after_create