recursive autodiscover_tasks #7179
Replies: 2 comments
-
can you share a use-case for this? |
Beta Was this translation helpful? Give feedback.
-
I have a use case for this. I am using Celery with Django and have an app 'rest' that is primarily a rest backend. Inside that are sub-packages named after the different django models I have ('accounts', 'goals', 'events', etc), so that I can keep my Django urls and views separate and modular. A few of these sub-packages have recurring tasks associated with them for celery-beat, so I made a tasks.py in each sub-package (technically for me jobs.py with I would love to just add |
Beta Was this translation helpful? Give feedback.
-
Checklist
for similar or identical feature requests.
for existing proposed implementations of this feature.
to find out if the if the same feature was already implemented in the
master branch.
in this issue (If there are none, check this box anyway).
Related Issues and Possible Duplicates
Related Issues
Possible Duplicates
Brief Summary
The autodiscover_tasks method checks modules in packages, but modules in subdirectories will not be imported. It will be convenient to add a recursive option which enables searching modules in packages and their subdirectories.
Design
Architectural Considerations
autodiscover_tasks(packages=None, related_name='tasks', force=False) will be changed to autodiscover_tasks(packages=None, related_name='tasks', force=False,recursive=False) for backward compatibility
Proposed Behavior
Proposed UI/UX
Diagrams
N/A
Alternatives
None
Beta Was this translation helpful? Give feedback.
All reactions