Skip to content

Commit

Permalink
we need to let our configuration actions finish (so that tasks are al…
Browse files Browse the repository at this point in the history
…l registered) before we can build the celery app
  • Loading branch information
cutz committed Feb 4, 2020
1 parent d863616 commit ff754f2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/nti/app/environments/tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ def includeme(config):
The celery application is made available as utility
registered as ICeleryApp
"""
app = configure_celery(settings=component.getUtility(ISettings))
def _build_celery():
app = configure_celery(settings=component.getUtility(ISettings))

interface.alsoProvides(app, ICeleryApp)
getGlobalSiteManager().registerUtility(app, ICeleryApp)
interface.alsoProvides(app, ICeleryApp)
getGlobalSiteManager().registerUtility(app, ICeleryApp)
app.finalize()

config.action(("celery", "finalize"), app.finalize)
config.action(("celery", "setup"), _build_celery)

0 comments on commit ff754f2

Please sign in to comment.