Skip to content

Commit

Permalink
Merge pull request #61 from NextThought/wait-for-tasks
Browse files Browse the repository at this point in the history
we need to let our configuration actions finish (so that tasks are al…
  • Loading branch information
cutz authored Feb 4, 2020
2 parents b668725 + ff754f2 commit 30d66cc
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 30d66cc

Please sign in to comment.