Mercurial > public > sg101
comparison custom_search/tasks.py @ 755:f97dd33ca52d
The logging API has changed in Celery 3.x. Update to it.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 04 Jan 2014 13:39:39 -0600 |
parents | aeafbf3ecebf |
children |
comparison
equal
deleted
inserted
replaced
754:a5a83971574b | 755:f97dd33ca52d |
---|---|
3 | 3 |
4 """ | 4 """ |
5 from __future__ import absolute_import | 5 from __future__ import absolute_import |
6 | 6 |
7 from celery import shared_task | 7 from celery import shared_task |
8 from celery.utils.log import get_task_logger | |
8 from django.conf import settings | 9 from django.conf import settings |
9 | 10 |
10 from queued_search.management.commands.process_search_queue import Command | 11 from queued_search.management.commands.process_search_queue import Command |
12 | |
13 logger = get_task_logger(__name__) | |
11 | 14 |
12 | 15 |
13 @shared_task | 16 @shared_task |
14 def process_search_queue_task(): | 17 def process_search_queue_task(): |
15 """ | 18 """ |
19 """ | 22 """ |
20 if settings.SEARCH_QUEUE_ENABLED: | 23 if settings.SEARCH_QUEUE_ENABLED: |
21 command = Command() | 24 command = Command() |
22 command.execute() | 25 command.execute() |
23 else: | 26 else: |
24 logger = process_search_queue_task.get_logger() | |
25 logger.warning("Search queue disabled; skipping processing") | 27 logger.warning("Search queue disabled; skipping processing") |