A few comments in tasks.py to clarify some tasks written to figure out celery

pull/1/head
Raymond Yee 2012-03-29 12:07:06 -07:00
parent 54393e5d78
commit c040e9137e
1 changed files with 2 additions and 0 deletions

View File

@ -31,10 +31,12 @@ def load_librarything_into_wishlist(user_id, lt_username, max_books=None):
@task
def add(x,y):
"""trivial task to add two numbers: don't delete this for now -- used in tests for learning about celery"""
return x+y
@task
def fac(n, sleep_interval=None):
"""a task used in core.tests.CeleryTaskTest to show example of how to report progress in tasks"""
if not(isinstance(n,int) and n >= 0):
raise Exception("You can't calculate a factorial of %s " % (str(n)))
if n <= 1: