bgneal@525: """ bgneal@525: Tasks for our custom search application. bgneal@525: bgneal@525: """ bgneal@750: from __future__ import absolute_import bgneal@750: bgneal@750: from celery import shared_task bgneal@755: from celery.utils.log import get_task_logger bgneal@726: from django.conf import settings bgneal@525: bgneal@525: from queued_search.management.commands.process_search_queue import Command bgneal@525: bgneal@755: logger = get_task_logger(__name__) bgneal@755: bgneal@525: bgneal@750: @shared_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.warning("Search queue disabled; skipping processing")