From bc66c68450adc11ea423924c65622edd248dc92f Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Sat, 19 Sep 2015 21:47:59 -0400 Subject: [PATCH] Add a 1 second delay to automatic OCR to avoid tasking OCR before document version is available in DB. --- mayan/apps/ocr/apps.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mayan/apps/ocr/apps.py b/mayan/apps/ocr/apps.py index 0431f06c94..4226a38af6 100644 --- a/mayan/apps/ocr/apps.py +++ b/mayan/apps/ocr/apps.py @@ -44,7 +44,9 @@ def document_ocr_submit(self): def document_version_ocr_submit(self): - task_do_ocr.apply_async(args=(self.pk,)) + task_do_ocr.apply_async( + kwargs={'document_version_pk': self.pk}, countdown=1 + ) class OCRApp(MayanAppConfig):