django-background-tasks
django-background-tasks copied to clipboard
Need a global shutoff setting.
For the purposes of testing and debugging it would be useful to have a global shutoff value that would cause all @background
decorated tasks to run synchronously. Celery has this with it's task-always-eager
setting.
I'm probably being naive, but an easy fix would be, on this line stick
if os.environ('TASK_ALWAYS_EAGER') == 'TRUE':
return self.task_function()
This is a good idea.
Maybe the env variable name should be defined in the settings.py
.
Another option is a file. If present, ...
Seems like this is a duplicate of #176