Tweak db connection closing to ensure a fresh connection to high frequency called code

This commit is contained in:
Roberto Rosario
2012-08-03 06:19:17 -04:00
parent 239f6467fe
commit 8b4cf87368
2 changed files with 3 additions and 2 deletions

View File

@@ -30,6 +30,7 @@ class Lock(models.Model):
@transaction.commit_on_success
def release(self):
try:
close_connection()
lock = Lock.objects.get(name=self.name, creation_datetime=self.creation_datetime)
lock.delete()
except Lock.DoesNotExist: