mercredi 10 avril 2019

Adding max attempt for a single delayed job

I am trying to add max_attempt(if that fails) for a single delayed job

@user.delay(attempts: 2).send_an_email 

and this shows attempts column in delayed job is missing

But could do that for the whole application with adding a delayed_job_config file in the initializer

# config/initializers/delayed_job_config.rb
  Delayed::Worker.max_attempts = 3
  Delayed::Worker.destroy_failed_jobs = false

Is there anyway to add it for single delayed job?

Aucun commentaire:

Enregistrer un commentaire