comparison wiki/tasks.py @ 750:aeafbf3ecebf

For #63, upgrade to celery 3.1.7.
author Brian Neal <bgneal@gmail.com>
date Tue, 31 Dec 2013 16:36:22 -0600
parents a4300639c6e7
children
comparison
equal deleted inserted replaced
749:b6e98717690b 750:aeafbf3ecebf
1 """ 1 """
2 Celery tasks for the wiki app. 2 Celery tasks for the wiki app.
3 3
4 """ 4 """
5 from __future__ import absolute_import
6
5 import datetime 7 import datetime
6 import logging 8 import logging
7 import time 9 import time
8 10
9 from celery.task import task 11 from celery import shared_task
10 from django.conf import settings 12 from django.conf import settings
11 import redis 13 import redis
12 14
13 from core.services import get_redis_connection 15 from core.services import get_redis_connection
14 16
15 17
16 logger = logging.getLogger(__name__) 18 logger = logging.getLogger(__name__)
17 19
18 20
19 @task 21 @shared_task
20 def expire_cookies(): 22 def expire_cookies():
21 """ 23 """
22 Periodically run this task to remove expired cookies from the Redis set 24 Periodically run this task to remove expired cookies from the Redis set
23 that is shared between this Django application & the MoinMoin wiki for 25 that is shared between this Django application & the MoinMoin wiki for
24 authentication. 26 authentication.