Lessons Learned


To list the current Celery tasks names in Redis queue, use:

import base64
from redis import StrictRedis
redis_client = StrictRedis.from_url(BROKER_URL)
default_queue = redis_client.lrange('celery', 0, -1)
print({json.loads(base64.b64decode(json.loads(message.decode('utf-8'))['body']).decode('utf-8'))['task'] for message in default_queue})

For reserved and active, use app.control.inspect(): http://docs.celeryproject.org/en/latest/userguide/workers.html#inspecting-workers

Did you like?

Always export and import CSV data specifying the dialect. I've just lost an hour with a bug. The lib I used for export was using the excel dialect and the lib I used for import was wrongly guessing some other dialect (because it reads only part of the CSV for guessing)

Did you like?