如果您的代理配置为
redis://localhost:6379/1,并且您的任务已提交到常规
celery队列,则可以通过以下方式获得长度:
import redisqueue_name = "celery"client = redis.Redis(host="localhost", port=6379, db=1)length = client.llen(queue_name)
或者,从shell脚本(适用于监视器等):
$ redis-cli -n 1 -h localhost -p 6379 llen celery



