def on_task_init(self, task_id, task):
        """Called before every task."""
        try:
            is_eager = task.request.is_eager
        except __HOLE__:
            is_eager = False
        if not is_eager:
            self.close_database()
dataset/ETHPy150Open celery/django-celery/djcelery/loaders.py/DjangoLoader.on_task_init