annotate custom_search/tasks.py @ 740:3e1905e523be

Django 1.6: get_query_set -> get_queryset, etc.
author Brian Neal <bgneal@gmail.com>
date Sun, 29 Dec 2013 12:57:03 -0600
parents f0b997651497
children aeafbf3ecebf
rev   line source
bgneal@525 1 """
bgneal@525 2 Tasks for our custom search application.
bgneal@525 3
bgneal@525 4 """
bgneal@726 5 from django.conf import settings
bgneal@525 6 from celery.task import task
bgneal@525 7
bgneal@525 8 from queued_search.management.commands.process_search_queue import Command
bgneal@525 9
bgneal@525 10
bgneal@525 11 @task
bgneal@525 12 def process_search_queue_task():
bgneal@525 13 """
bgneal@525 14 Celery task to run the queued_search application's process_search_queue
bgneal@525 15 command.
bgneal@525 16
bgneal@525 17 """
bgneal@726 18 if settings.SEARCH_QUEUE_ENABLED:
bgneal@726 19 command = Command()
bgneal@726 20 command.execute()
bgneal@726 21 else:
bgneal@726 22 logger = process_search_queue_task.get_logger()
bgneal@726 23 logger.warning("Search queue disabled; skipping processing")