workless
workless copied to clipboard
Workers not scaled when using mongoid because pending jobs incorrectly == 0
I'm using workless with delayed_job_mongoid 2.0.0 on heroku. It seems that the scaler doesn't think it needs any workers because self.jobs.count == 0. I believe this is due to the different query syntax for mongoid and ActiveRecord. What is the best way to fix this?
class Base
def self.jobs
Delayed::Job.all(:conditions => { :failed_at => nil })
end
end
Apologies for my absence and in getting back to you. Is this still an issue you see with the latest version of the gem?
@lostboy @adamloving Should be fixed with - https://github.com/lostboy/workless/pull/75 - please merge.