Skip to content

Commit

Permalink
Merge pull request #10 from Volumental/close_all_connections
Browse files Browse the repository at this point in the history
close all connection before loading tasks
  • Loading branch information
silviaVolumental authored Oct 3, 2018
2 parents 51a591a + 7150090 commit defc109
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions django_leek/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .helpers import load_task
from . import worker
from . import helpers
import django

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit defc109

Please sign in to comment.