I am new to Celery and I was trying to set up a simple script for scheduling and scheduling tasks. However, I feel that I am confused by a strange problem. I have the following setting
from celery import Celery
app = Celery('celery_test',
broker='amqp://',
backend='amqp')
@app.task
def add(x, y):
return x + y
I start my celery server very well and can add tasks. Now, when I want to get a list of active tasks, everything looks strange. When I use the inspector to get a list of scheduled tasks, it works exactly once, and then returns None every time after that.
>>> i = app.control.inspect()
>>> print i.scheduled()
{u'celery@mymachine': []}
>>> print i.scheduled()
None
>>>
This happens if I add tasks or not. I want to find a way to consistently return a list of tasks from my celery queue. I want to do this in order to find a previously set task, cancel it and transfer it. I feel that I am missing something basic.