diff gpp/accounts/tasks.py @ 520:e94570675664

Created stats for users (number of users and list of newest users). Better separated the forums, who's online, and user stats. Use a Celery task to execute the new user stats processing. This addresses #194 and #238.
author Brian Neal <bgneal@gmail.com>
date Sat, 17 Dec 2011 23:19:15 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gpp/accounts/tasks.py	Sat Dec 17 23:19:15 2011 +0000
@@ -0,0 +1,16 @@
+"""
+Celery tasks for the accounts application.
+
+"""
+from celery.task import task
+
+from accounts.stats import update_user_stats
+
+
+@task
+def user_stats_task(user_id):
+    """
+    Run the update_user_stats() function on a new task.
+
+    """
+    update_user_stats(user_id)