Building on this question:
Django Celery Time Limit Exceeded?
I have some tasks that may run for sometime. However, most tasks should not take more then a few seconds. I don’t want to set the global timeout to account for those long running tasks. Rather, I would like to have a global hard timelimit that is short, and manually adjust the tasks that I need to have a longer timeout.
When decorating the task with @task I did @task(timeout=None) and yet, that task still hit a timeout of 300 seconds. I called the task with task_function.delay(args).
Is there a way to call a task and customize it’s timeout?
This issue addresses the case when you can call a task with custom timeouts. It is implemented in issue802 branch but isn’t in master yet. You can merge it with master and use the desired functionality.
With this patch, you can pass timeouts when calling tasks.