Skip to content

Commit

Permalink
upgrade search celery app in project
Browse files Browse the repository at this point in the history
  • Loading branch information
Friskes committed May 30, 2024
1 parent 292fa46 commit d07370e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/celery_starter/management/commands/runcelery.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,13 @@ def get_celery_app(self) -> tuple[str, str | None]:
if cmd[i].startswith('--app'):
return cmd[i].split('=')[-1].strip(), self.args[0]
else:
if os.environ.get('CELERY_APP'):
return os.environ['CELERY_APP'], None
celery_app = (
os.environ.get('CELERY_APP', None)
or getattr(settings, 'CELERY_APP', None)
or default_app.conf.get('CELERY_APP', 'app')
)
if celery_app:
return celery_app, None

settings_filename = 'settings.py'
for root, _dirs, files in os.walk(self.BASE_DIR):
Expand Down

0 comments on commit d07370e

Please sign in to comment.