推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
RynItme
V2EX  ›  Python

celery 清空任务队列的疑问

  •  
  •   RynItme · May 21, 2019 · 4575 views
    This topic created in 2692 days ago, the information mentioned may be changed or developed.
    目前在用 celery broker backend 都是 redis 。 有一个需求是要查看所有的 等待执行的延迟任务 和 清空等待执行的任务。 有一个方式是操作 redis 代码层面有没有好的方式。
    2 replies  •  2019-05-21 15:09:27 +08:00
    a852695
        1
    a852695  
       May 21, 2019
    同直接操作 redis
    RynItme
        2
    RynItme  
    OP
       May 21, 2019
    from proj.celery import app
    app.control.purge()

    官网是有这种方式 然而 我操作之后返回条数为 0
    reids 中 unacked_index 这个索引厉害依然存在数据


    ```
    127.0.0.1:6379> ZRANGE unacked_index 0 10 WITHSCORES
    1) "dc96716a-c8f7-4797-9029-64eb0a7ffd22"
    2) "1558418885.3853481"
    3) "01d96271-a3b8-418d-aa88-0117db7ebd69"
    4) "1558421585.326695"

    ```
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1185 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 16:51 · PVG 00:51 · LAX 09:51 · JFK 12:51
    ♥ Do have faith in what you're doing.