Mercurial > public > sg101
diff gpp/forums/tasks.py @ 522:82b97697312e
Created Celery tasks to process new posts and topics. Keep the updated topic set in Redis.
This is for tickets #194, #237, #239.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 18 Dec 2011 23:46:52 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gpp/forums/tasks.py Sun Dec 18 23:46:52 2011 +0000 @@ -0,0 +1,25 @@ +""" +Celery tasks for the forums application. + +""" +from celery.task import task + +import forums.latest + + +@task +def new_post_task(post_id): + """ + This task performs new post processing on a Celery task. + + """ + forums.latest.process_new_post(post_id) + + +@task +def new_topic_task(topic_id): + """ + This task performs new topic processing on a Celery task. + + """ + forums.latest.process_new_topic(topic_id)