推荐学习书目
› 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
lauix
V2EX  ›  Python

celery 有失败任务,怎么回事?

  •  
  •   lauix · Jul 18, 2017 · 4584 views
    This topic created in 3397 days ago, the information mentioned may be changed or developed.
    • flask 项目

    celery = Celery(name, broker=CELERY_BROKER, include=CELERY_IMPORTS)

    只用了个 broker 没有用 backend ,broker 是用的 redis

    上面是用 Flower 的观察结果,大概是 每创建 3 次任务,只有一次任务成功。

    求解怎么回事?

    9 replies  •  2019-10-24 14:36:49 +08:00
    scriptB0y
    scriptB0y
    Jul 18, 2017
    1
    贴日志出来
    akmonde
    akmonde
    Jul 19, 2017
    2
    兄弟你这不贴错误日志和报错,别人怎么帮你。
    lauix
    lauix
    OP
    Jul 19, 2017
    3
    @scriptB0y
    @akmonde
    日记无任何错误,找到原因了,supervisor stop 关闭不了 celery 进程,然后用手动启动了个,所以一会成功,一会失败。
    0ZXYDDu796nVCFxq
    0ZXYDDu796nVCFxq
    Jul 19, 2017
    4
    前面两个任务,有错误没有处理好啊
    不要用 one(), 如果数据库有做约束,那就 first()
    或者简单点 one_or_none()
    Kcelone
    Kcelone
    Sep 27, 2018
    5
    请问你这个后面是怎么解决的?我现在遇到个类似问题,就是任务有时候会注册不成功,redis 中返回结果是 "result": {
    "exc_type": "NotRegistered",
    "exc_message": "'tasks.excel.excel_to_db'"
    },请问知道是哪里出了问题吗?
    CyJaySong
    CyJaySong
    Apr 18, 2019
    6
    @Kcelone 我也遇到这个问题,您解决了没
    CyJaySong
    CyJaySong
    Apr 18, 2019
    7
    @lauix 我也是使用的 supervisor 启动 celery,任务有时候能执行有时候报 NotRegistered。。您是怎么解决的呢
    eteryao
    eteryao
    Oct 21, 2019
    8
    @Kcelone 请问解决了么。。。
    Kcelone
    Kcelone
    Oct 24, 2019
    9
    @eteryao 解决了,检查自己的任务函数,发现点问题,换了种方式,然后就正常了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4545 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 49ms · UTC 09:39 · PVG 17:39 · LAX 01:39 · JFK 04:39
    ♥ Do have faith in what you're doing.