首页 > 如何查看Celery存储在redis里面的结果?

如何查看Celery存储在redis里面的结果?

app = Celery('tasks', backend='amqp', broker='amqp://')
Or if you want to use Redis as the result backend, but still use RabbitMQ as the message broker (a popular combination):

app = Celery('tasks', backend='redis://localhost', broker='amqp://')

=========

  Redis 命令行结果
  127.0.0.1:6379> keys *
 1) "emails"
 2) "mmtest"
 3) "_kombu.binding.celery"
 4) "_kombu.binding.celeryev"
 5) "celery-task-meta-f418abea-7827-4220-b72e-a0669e8b8a08"
 6) "celery-task-meta-43105310-a8e2-483b-bd8a-8a54affc9192"
 7) "_kombu.binding.celery.pidbox"
 8) "name"
 9) "unacked_mutex"
10) "email"
11) "mygmail"
12) "myyahoo"

如何产看redis里面的存储内容?


这个其实可以算Redis的问题。

使用 type 命令查看对应的数据类型,再使用其他命令查看内容

> type $key

例如对于最基本的键值,使用 get $key 即可。对于 list ,使用 lrange (由于是拿一个范围,需要先用 llen 获取长度作为参数)。

当然,在Python下调用Redis客户端的相关命令也是可以实现的。

【热门文章】
【热门文章】