Skip to content

Commit

Permalink
fix: add database config to Celery app
Browse files Browse the repository at this point in the history
  • Loading branch information
kushagra189 committed Nov 10, 2022
1 parent a9b83ae commit f476cf1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions foca/foca.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,16 @@ def create_celery_app(self) -> Celery:
cnx_app = register_exception_handler(cnx_app)
logger.info("Error handler registered.")

# Register MongoDB
if self.conf.db:
cnx_app.app.config.foca.db = register_mongodb(
app=cnx_app.app,
conf=self.conf.db,
)
logger.info("Database registered.")
else:
logger.info("No database support configured.")

# Create Celery app
if self.conf.jobs:
celery_app = create_celery_app(cnx_app.app)
Expand Down
2 changes: 1 addition & 1 deletion foca/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Single source of truth for package version."""

__version__ = '0.11.0'
__version__ = '0.12.0'

0 comments on commit f476cf1

Please sign in to comment.