Hi we are using Python Huey https://pypi.org/project/huey/1.1.0/ on a django project for running our background task, we are use it as a decorator @task() on some functions. To be more precise we are importing the library the following way:
from huey.contrib.djhuey import task
So, on our functions, that are executed by this task, in some cases we have database connections. If for some reason this task fails, for example, today we had a database issue that the connections to the database were closing (this is an issue that we have to figure out why this connections were closing). As you may imagine the task doesn't finish it's job due to the database connection.
My question is: Is there any way, that we can configure this Huey task to retry the execution. Let's say, retry 5 times with 2 seconds between each retry ?
Yes you can. The huey documation explains this:
Or setting a custom retry delay: