I'm fairly new to Celery and I've been attempting setup a simple script to schedule and unschedule tasks. However I feel like I'm running into a weird issue. I have the following setup
from celery import Celery
app = Celery('celery_test',
broker='amqp://',
backend='amqp')
@app.task
def add(x, y):
return x + y
I start up my celery server just fine and can add tasks. Now when I want to get a list of active tasks things seem to get weird. When I goto use inspect to get a list of scheduled tasks it works exactly once then returns None every time afterwards.
>>> i = app.control.inspect()
>>> print i.scheduled()
{u'celery@mymachine': []}
>>> print i.scheduled()
None
>>>
This happens whether 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 so I can find a previously queued task, revoke it, and reschedule it. I feel like I'm missing something basic here.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…