Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed _modules #766

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Removed _modules #766

wants to merge 2 commits into from

Conversation

gotounix
Copy link

@gotounix gotounix commented Jul 4, 2024

@cclauss
Copy link
Contributor

cclauss commented Jul 4, 2024

flake8...................................................................Failed

django_celery_beat/admin.py:3:1: F401 'celery.utils.cached_property' imported but unused

@cclauss
Copy link
Contributor

cclauss commented Jul 4, 2024

Related to #764?

@zbig17 Your review, please.

@zbig17
Copy link

zbig17 commented Jul 4, 2024

self.celery_app.loader.import_default_modules() is needed to have full list of available tasks. The cached_property _modules is a trick to do it once.

Usually celery configuration in the django project contains app.autodiscover_tasks(). This is lazy function, executed on receiving import_modules signal. Without calling import_default_modules, many tasks can stay undiscovered.

Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on #766 (comment)

We could close this, IMHO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants