From 8c02c4c426d436e635aea5fcd976583e66039dbf Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Fri, 2 Dec 2011 05:55:42 -0400 Subject: [PATCH] Disable ocr document queue signal It appears Django executes signals using the same process as the caller, effectively blocking the view until the OCR process completes which could take several minutes :/ --- apps/ocr/__init__.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/ocr/__init__.py b/apps/ocr/__init__.py index def0d7064b..b07fa07d72 100644 --- a/apps/ocr/__init__.py +++ b/apps/ocr/__init__.py @@ -108,11 +108,14 @@ def document_post_save(sender, instance, **kwargs): post_save.connect(document_post_save, sender=Document) -@receiver(post_save, dispatch_uid='call_queue', sender=QueueDocument) -def call_queue(sender, **kwargs): - if kwargs.get('created', False): - logger.debug('got call_queue signal: %s' % kwargs) - task_process_document_queues() +# Disabled because it appears Django execute signals using the same +# process effectively blocking the view until the OCR process completes +# which could take several minutes :/ +#@receiver(post_save, dispatch_uid='call_queue', sender=QueueDocument) +#def call_queue(sender, **kwargs): +# if kwargs.get('created', False): +# logger.debug('got call_queue signal: %s' % kwargs) +# task_process_document_queues() create_default_queue()