From b6e8478dafd5bea625f6ec7cece2c3b4ba189883 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Fri, 23 May 2014 17:44:07 -0400 Subject: [PATCH] Revert "Close connection before and after executing periodic OCR task, to avoid stale DB connection remaining open. Ref: Issue #4" This reverts commit ee1e732776fff16e9204c167ac84f34f09d3b202. 73ebc06275ddcf763d6073e47d541a2d990bd69d Supersedes this one, thanks a lot to Mathias Behrle for uncovering this bug and all the help squashing it! --- apps/ocr/tasks.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/apps/ocr/tasks.py b/apps/ocr/tasks.py index 0e69e13bb2..84d2c956d2 100644 --- a/apps/ocr/tasks.py +++ b/apps/ocr/tasks.py @@ -5,7 +5,6 @@ import platform import logging from django.db.models import Q -from django import db from job_processor.api import process_job from lock_manager import Lock, LockError @@ -49,8 +48,6 @@ def task_process_queue_document(queue_document_id): def task_process_document_queues(): - # Make sure this task get a fresh connection to the database - db.close_connection() logger.debug('executed') # TODO: reset_orphans() q_pending = Q(state=QUEUEDOCUMENT_STATE_PENDING) @@ -77,6 +74,3 @@ def task_process_document_queues(): logger.debug('already processing maximum') else: logger.debug('nothing to process') - - # Close the database explicitly or else Django keeps it open - db.close_connection()