Mercurial > public > sg101
comparison custom_search/tasks.py @ 726:f0b997651497
For #54, provide a flag to skip search queue processing.
This is useful when we are rebuilding the index.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 22 Sep 2013 12:00:46 -0500 |
parents | ee87ea74d46b |
children | aeafbf3ecebf |
comparison
equal
deleted
inserted
replaced
725:682b159f3763 | 726:f0b997651497 |
---|---|
1 """ | 1 """ |
2 Tasks for our custom search application. | 2 Tasks for our custom search application. |
3 | 3 |
4 """ | 4 """ |
5 from django.conf import settings | |
5 from celery.task import task | 6 from celery.task import task |
6 | 7 |
7 from queued_search.management.commands.process_search_queue import Command | 8 from queued_search.management.commands.process_search_queue import Command |
8 | 9 |
9 | 10 |
12 """ | 13 """ |
13 Celery task to run the queued_search application's process_search_queue | 14 Celery task to run the queued_search application's process_search_queue |
14 command. | 15 command. |
15 | 16 |
16 """ | 17 """ |
17 command = Command() | 18 if settings.SEARCH_QUEUE_ENABLED: |
18 command.execute() | 19 command = Command() |
20 command.execute() | |
21 else: | |
22 logger = process_search_queue_task.get_logger() | |
23 logger.warning("Search queue disabled; skipping processing") |