diff core/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 53a56d19568c
children 79a71b9d0a2a
line wrap: on
line diff
--- a/core/tasks.py	Mon Dec 30 15:05:43 2013 -0600
+++ b/core/tasks.py	Tue Dec 31 16:36:22 2013 -0600
@@ -2,22 +2,15 @@
 Celery tasks for the core application.
 
 """
-from celery.task import task
+from __future__ import absolute_import
+
+from celery import shared_task
 import django.core.mail
 
 import core.whos_online
 
 
-@task
-def add(x, y):
-    """
-    It is useful to have a test task laying around. This is it.
-
-    """
-    return x + y
-
-
-@task
+@shared_task
 def send_mail(subject, message, from_email, recipient_list, **kwargs):
     """
     A task to send mail via Django.
@@ -27,7 +20,7 @@
             **kwargs)
 
 
-@task
+@shared_task
 def cleanup():
     """
     A task to perform site-wide cleanup actions.
@@ -51,7 +44,7 @@
     command.execute()
 
 
-@task
+@shared_task
 def max_users():
     """
     Run the periodic task to calculate the who's online max users/visitors