how to remove task from celery with redis broker?

timger picture timger · Jun 19, 2013 · Viewed 18.1k times · Source

I Have add some wrong task to a celery with redis broker

but now I want to remove the incorrect task and I can't find any way to do this

Is there some commands or some api to do this ?

Answer

Artem Mezhenin picture Artem Mezhenin · Jun 22, 2013

I know two ways of doing so:

1) Delete queue directly from broker. In your case it's Redis. There are two commands that could help you: llen (to find right queue) and del (to delete it).

2) Start celery worker with --purge or --discard options. Here is help:

--purge, --discard    Purges all waiting tasks before the daemon is started.
                      **WARNING**: This is unrecoverable, and the tasks will
                      be deleted from the messaging server.