V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
u2gign
V2EX  ›  Python

celery 中为啥程序失败了还是返回 task.state=success

  •  
  •   u2gign · 2020-04-29 14:25:57 +08:00 · 1974 次点击
    这是一个创建于 1429 天前的主题,其中的信息可能已经有所发展或是发生改变。
    4 条回复    2020-04-30 11:28:07 +08:00
    SingeeKing
        1
    SingeeKing  
       2020-04-29 14:42:48 +08:00
    如果不想这样有 echo 机制,可以看看相关文档

    默认 success 是指的任务执行过了,到底是否执行成功了不考虑;如果设定为不成功再继续执行是有风险的(每次都执行失败浪费资源),一般要配合死信队列来一起设计逻辑
    est
        2
    est  
       2020-04-29 15:20:43 +08:00
    state=success 表示快递员已经送达了。包裹内物品是否如实描述是你的事
    u2gign
        3
    u2gign  
    OP
       2020-04-29 16:16:09 +08:00
    了解了 多谢各位
    deplives
        4
    deplives  
       2020-04-30 11:28:07 +08:00
    celery 描述的 state 是指是否运行了,但是运行是否出错了他不管
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1059 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 22:40 · PVG 06:40 · LAX 15:40 · JFK 18:40
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.