Skip to content

Commit

Permalink
Merge e731f70 into a3d2f18
Browse files Browse the repository at this point in the history
  • Loading branch information
egabancho committed Sep 25, 2015
2 parents a3d2f18 + e731f70 commit dec5a5c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions invenio_celery/__init__.py
Expand Up @@ -27,6 +27,7 @@

from celery import Celery, signals
from celery.loaders.base import BaseLoader
from flask import has_app_context

from . import registry
from .version import __version__
Expand Down Expand Up @@ -131,6 +132,8 @@ def read_configuration(self):
def close_database(self, **dummy_kwargs):
if self.db:
self.db.session.remove()
if has_app_context():
self.db.engine.dispose()

def import_default_modules(self):
""" Called before on_worker_init """
Expand Down

0 comments on commit dec5a5c

Please sign in to comment.