Skip to content
Advertisement

When is on_failure called by celery when retrying

I’m using Task Inheritance in celery to retry (max_retries: 3) on certain exceptions, and log failures.

Is on_failure called on each failed attempt or only after the last attempt (the 3rd in my case)?

JavaScript

Advertisement

Answer

Tested this and on_failure is only run after the retries have all failed.

So, using the example given above, on_failure is called after the 3rd failure.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement