Unify the method to submit document for OCR, fix OCR error document re-queue view

This commit is contained in:
Roberto Rosario
2014-10-09 14:08:48 -04:00
parent 8bac1525be
commit c2e35694d8
5 changed files with 14 additions and 31 deletions

View File

@@ -24,6 +24,8 @@ def task_do_ocr(document_pk):
lock_id = u'task_do_ocr_doc-%d' % document_pk
try:
logger.debug('trying to acquire lock: %s' % lock_id)
# Acquire lock to avoid doing OCR on the same document more than once
# concurrently
lock = Lock.acquire_lock(lock_id, LOCK_EXPIRE)
logger.debug('acquired lock: %s' % lock_id)
try: