Open tgmerritt opened 9 years ago
I patched my own version of delayed_job to shove this attribute into the record on enqueue - and the attribute is now present but workless is still not activating on my staging environment.
Yes I've set my APP_NAME and HEROKU_API_KEY env vars on Heroku - it seems the after_create callback just isn't firing when the record is created. This is specific to MongoID as my current production environment uses MongoMapper and Workless is working just fine. We're migrating over to MongoID and the problems have arisen from that.
Gemfile.lock snippets:
workless (1.1.3)
delayed_job (>= 2.0.7)
heroku-api
rails
rush
delayed_job (4.0.6)
activesupport (>= 3.0, < 5.0)
delayed_job_mongoid (2.1.0)
delayed_job (>= 3.0, < 5)
mongoid (>= 3.0, < 5)
delayed_job_tgmerritt (4.0.7)
activesupport (>= 3.0, < 5.0)
Reading through the source of Workless, you check for failed_at attribute of the backend table:
But unfortunately when we're using the delayed_job_mongoid gem (which is where I think the problem is ultimately) we don't get this field. Here is an example document from my db:
Therefore there are always no jobs return - so workless never fires.
I'm submitting the issue for documentation to others who might be searching, as well as to alert the team to consider alternative attributes to pivot on.
Because Workless limits attempts to 3, I think it might be better to pivot on this field.