jeudi 1 décembre 2016

Queued jobs with individual max number of tries, how to?

Normally, the max tries are specified on the queue level like so:

php artisan queue:listen connection-name --tries=3

I would like to be able to override this (without affecting other jobs) on the job level within the job class.

I can think of three ways to go about this but they may not be elegant:

  1. Set a high number of tries on queue level
  2. Look into the failed queue and retry the job
  3. Create a new job upon failure

Note:

  1. My case is related to polling via API.
  2. I am recording my poll attempts within my own model.


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire