Revert "Close connection before and after executing periodic OCR task, to avoid stale DB connection remaining open. Ref: Issue #4"
This reverts commitee1e732776.73ebc06275Supersedes this one, thanks a lot to Mathias Behrle for uncovering this bug and all the help squashing it!
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user