-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Labels
database-backendIssues relating to the database backendIssues relating to the database backend
Description
Running django-tasks with the database backend lets a worker run forever without any activity.
Example:
# jobs.py
from django_tasks import task, TaskContext
@task(takes_context=True, queue_name='test01')
def calculate_meaning_of_life(context: TaskContext) -> int:
print(context)
return 42
if __name__ == '__main__':
print(calculate_meaning_of_life.enqueue())Run this file twice. We will have two tasks with the task path __main__.calculate_meaning_of_life (which does not look right as well).
Starting the respective worker now will fail to resolve the task path and raise an ImportError for the first task result, which goes into the state "Failed". Afterwards, the worker seems to be broken and the second task result remains "Ready". I would have expected the worker to just continue with the next task result.
If the exception is raised inside the task itself, the worker is not getting stuck.
Metadata
Metadata
Assignees
Labels
database-backendIssues relating to the database backendIssues relating to the database backend