bgneal@525: """ bgneal@525: Tasks for our custom search application. bgneal@525: bgneal@525: """ bgneal@726: from django.conf import settings bgneal@525: from celery.task import task bgneal@525: bgneal@525: from queued_search.management.commands.process_search_queue import Command bgneal@525: bgneal@525: bgneal@525: @task bgneal@525: def process_search_queue_task(): bgneal@525: """ bgneal@525: Celery task to run the queued_search application's process_search_queue bgneal@525: command. bgneal@525: bgneal@525: """ bgneal@726: if settings.SEARCH_QUEUE_ENABLED: bgneal@726: command = Command() bgneal@726: command.execute() bgneal@726: else: bgneal@726: logger = process_search_queue_task.get_logger() bgneal@726: logger.warning("Search queue disabled; skipping processing")