diff --git a/django_leek/server.py b/django_leek/server.py index e6e6c62..fa4c4d0 100644 --- a/django_leek/server.py +++ b/django_leek/server.py @@ -5,6 +5,7 @@ from .helpers import load_task from . import worker from . import helpers +import django log = logging.getLogger(__name__) @@ -41,6 +42,7 @@ def handle(self): log.info('Got a task') try: task_id = int(data.decode()) + django.db.connections.close_all() queued_task = load_task(task_id=task_id) # Ensure pool got a worker processing it