* Added a new option OCR_REPLICATION_DELAY to allow the storage some time for replication before attempting to do OCR to a document
This commit is contained in:
@@ -3,3 +3,4 @@ from django.conf import settings
|
|||||||
TESSERACT_PATH = getattr(settings, 'OCR_TESSERACT_PATH', u'/usr/bin/tesseract')
|
TESSERACT_PATH = getattr(settings, 'OCR_TESSERACT_PATH', u'/usr/bin/tesseract')
|
||||||
TESSERACT_LANGUAGE = getattr(settings, 'OCR_TESSERACT_LANGUAGE', None)
|
TESSERACT_LANGUAGE = getattr(settings, 'OCR_TESSERACT_LANGUAGE', None)
|
||||||
MAX_CONCURRENT_EXECUTION = getattr(settings, 'OCR_MAX_CONCURRENT_EXECUTION', 2)
|
MAX_CONCURRENT_EXECUTION = getattr(settings, 'OCR_MAX_CONCURRENT_EXECUTION', 2)
|
||||||
|
REPLICATION_DELAY = getattr(settings, 'OCR_REPLICATION_DELAY', 360) #In seconds, 360 = 6 minutes
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ from literals import QUEUEDOCUMENT_STATE_PENDING, \
|
|||||||
QUEUEDOCUMENT_STATE_ERROR
|
QUEUEDOCUMENT_STATE_ERROR
|
||||||
from models import QueueDocument, DocumentQueue
|
from models import QueueDocument, DocumentQueue
|
||||||
from ocr.conf.settings import MAX_CONCURRENT_EXECUTION
|
from ocr.conf.settings import MAX_CONCURRENT_EXECUTION
|
||||||
|
from ocr.conf.settings import REPLICATION_DELAY
|
||||||
|
|
||||||
|
|
||||||
@task
|
@task
|
||||||
@@ -39,7 +40,7 @@ class DocumentQueueWatcher(PeriodicTask):
|
|||||||
if current_running_queues < MAX_CONCURRENT_EXECUTION:
|
if current_running_queues < MAX_CONCURRENT_EXECUTION:
|
||||||
try:
|
try:
|
||||||
oldest_queued_document = document_queue.queuedocument_set.filter(
|
oldest_queued_document = document_queue.queuedocument_set.filter(
|
||||||
state=QUEUEDOCUMENT_STATE_PENDING).order_by('datetime_submitted')[0]
|
state=QUEUEDOCUMENT_STATE_PENDING).filter(datetime_submitted__lt=datetime.datetime.now()-datetime.timedelta(seconds=REPLICATION_DELAY)).order_by('datetime_submitted')[0]
|
||||||
|
|
||||||
task_process_queue_document(oldest_queued_document.id).delay()
|
task_process_queue_document(oldest_queued_document.id).delay()
|
||||||
except:
|
except:
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
2011-Mar-21
|
2011-Mar-21
|
||||||
* Added a new diagnostics tab under the tools menu
|
* Added a new diagnostics tab under the tools menu
|
||||||
|
* Added a new option OCR_REPLICATION_DELAY to allow the storage some
|
||||||
|
time for replication before attempting to do OCR to a document
|
||||||
|
|
||||||
2011-Mar-20
|
2011-Mar-20
|
||||||
* Added simple statistics page (total used storage, total docs, etc)
|
* Added simple statistics page (total used storage, total docs, etc)
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ TODO, WISHLIST
|
|||||||
* Change to model signals - NOT NEEDED, found way to prevent save method recursion
|
* Change to model signals - NOT NEEDED, found way to prevent save method recursion
|
||||||
* Show current page in generic list template - DONE
|
* Show current page in generic list template - DONE
|
||||||
* Enable/disable ocr queue view & links - DONE
|
* Enable/disable ocr queue view & links - DONE
|
||||||
|
* Android App - NOT NEEDED (Use CamSanner, (C) IntSig Information Co, Ltd.)
|
||||||
|
|
||||||
* Receive documents via email
|
* Receive documents via email
|
||||||
* Mobile version
|
* Mobile version
|
||||||
|
|||||||
@@ -244,6 +244,7 @@ LOGIN_EXEMPT_URLS = (
|
|||||||
#OCR_TESSERACT_PATH = u'/usr/bin/tesseract'
|
#OCR_TESSERACT_PATH = u'/usr/bin/tesseract'
|
||||||
#OCR_MAX_CONCURRENT_EXECUTION = 2
|
#OCR_MAX_CONCURRENT_EXECUTION = 2
|
||||||
#OCR_TESSERACT_LANGUAGE = None
|
#OCR_TESSERACT_LANGUAGE = None
|
||||||
|
#OCR_REPLICATION_DELAY = 360
|
||||||
|
|
||||||
# Permissions
|
# Permissions
|
||||||
#ROLES_DEFAULT_ROLES = []
|
#ROLES_DEFAULT_ROLES = []
|
||||||
|
|||||||
Reference in New Issue
Block a user