comparison forums/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 f3fded5df64b
children
comparison
equal deleted inserted replaced
749:b6e98717690b 750:aeafbf3ecebf
1 """ 1 """
2 Celery tasks for the forums application. 2 Celery tasks for the forums application.
3 3
4 """ 4 """
5 from celery.task import task 5 from __future__ import absolute_import
6
7 from celery import shared_task
6 8
7 import forums.latest 9 import forums.latest
8 10
9 11
10 @task 12 @shared_task
11 def new_post_task(post_id): 13 def new_post_task(post_id):
12 """ 14 """
13 This task performs new post processing on a Celery task. 15 This task performs new post processing on a Celery task.
14 16
15 """ 17 """
16 forums.latest.process_new_post(post_id) 18 forums.latest.process_new_post(post_id)
17 19
18 20
19 @task 21 @shared_task
20 def updated_post_task(post_id): 22 def updated_post_task(post_id):
21 """ 23 """
22 This task performs updated post processing on a Celery task. 24 This task performs updated post processing on a Celery task.
23 25
24 """ 26 """
25 forums.latest.process_updated_post(post_id) 27 forums.latest.process_updated_post(post_id)
26 28
27 29
28 @task 30 @shared_task
29 def new_topic_task(topic_id): 31 def new_topic_task(topic_id):
30 """ 32 """
31 This task performs new topic processing on a Celery task. 33 This task performs new topic processing on a Celery task.
32 34
33 """ 35 """
34 forums.latest.process_new_topic(topic_id) 36 forums.latest.process_new_topic(topic_id)
35 37
36 38
37 @task 39 @shared_task
38 def updated_topic_task(topic_id): 40 def updated_topic_task(topic_id):
39 """ 41 """
40 This task performs updated topic processing on a Celery task. 42 This task performs updated topic processing on a Celery task.
41 43
42 """ 44 """