django-tasks
django-tasks copied to clipboard
Worker with --batch flag does not exit when no more tasks are available
Description:
When running the worker with the --batch flag, it is expected that the worker processes available tasks and then exits. However, the worker remains running indefinitely even when there are no more tasks to process.
Steps to Reproduce:
-
Queue some tasks.
-
Run the worker using:
python manage.py tasks_worker --batch
- Wait until all tasks are processed.
Expected Behavior:
The worker should exit gracefully once all queued tasks have been processed, as implied by the --batch mode.
Actual Behavior:
The worker remains idle and does not exit, requiring manual termination.