In documents a link about expiration
I use:
from tasks import add result = add.apply_async(args=[10, 10], expires=6000) printus(result) def printus(result): print (result)
tasks.py
from celery.task import task @task def add(x, y): return x + y
In celery:
[2012-03-21 19:50:03,012: WARNING/MainProcess] Skipping revoked task: tasks.add[4ffcff91-b12b-4bce-8d47-159314759859]
In the console:
4ffcff91-b12b-4bce-8d47-159314759859 True Traceback (most recent call last): File "/home/echeg/Dropbox/my_py/opoveshun/tests/celery/run_task.py", line 53, in <module> tr.countdown() File "/home/echeg/Dropbox/my_py/opoveshun/tests/celery/run_task.py", line 26, in countdown self.printus(result) File "/home/echeg/Dropbox/my_py/opoveshun/tests/celery/run_task.py", line 48, in printus print (result.get())
Why am I getting an exception? Result did not expire
If I use:
result = add.apply_async(args=[10, 10])
everything is fine
226107de-f739-4860-83bc-d843f17a257e False None 20 20 True
Echeg source share