django-q icon indicating copy to clipboard operation
django-q copied to clipboard

How to disable retries?

Open igalci opened this issue 3 years ago • 4 comments

I have already tried to set max_attempts=1 and tried 0 too and it is still retrying once before stopping.

All my failed tasks have "attempt = 2" as the number of attempts tried, even though max_attempts is 1.

Is this a bug? or am I doing it wrong?

igalci avatar Aug 20 '21 06:08 igalci

As per the documentation, 0 retries is actually infinite. It would make more sense to make -1 as infinite and 0 as literally "don't retry"

jasonbodily avatar Oct 06 '21 22:10 jasonbodily

As per the documentation, 0 retries is actually infinite. It would make more sense to make -1 as infinite and 0 as literally "don't retry"

Well I tried that just in case, but I am wondering why the 1 retries is not working

igalci avatar Oct 06 '21 23:10 igalci

Agreed with the sentiment here. Setting max_attempts to 0 should really have the system not attempt retries. Either None or -1 should be the "infinite" case.

I am also having issues with max_attempt. My assumption was that this would limit the number of retries issued (whether the task hit the retry value or whether the task failed). It seems that this value only limits the number of retries issued based on whether the task failed.

If this is the case, then there needs to be an option to set retry to None.

jpuerto-psc avatar Oct 07 '21 15:10 jpuerto-psc

Any updates on this?

mohammedhammoud avatar Mar 22 '23 23:03 mohammedhammoud