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

celery 的可见性超时应该设置在 server 端还是 worker 端?

  •  
  •   smallpython · Aug 16, 2019 · 2751 views
    This topic created in 2609 days ago, the information mentioned may be changed or developed.
    BROKER_TRANSPORT_OPTIONS={'visibility_timeout': 1800}

    就这个参数

    感觉这个参数设置的不对

    任务老重复执行
    5 replies  •  2019-08-16 21:24:30 +08:00
    Latin
        1
    Latin  
       Aug 16, 2019
    celery_once 了解一下
    smallpython
        2
    smallpython  
    OP
       Aug 16, 2019
    @Latin 我的任务重复是必现的,应该是我的逻辑有问题,

    原来没有出现过
    glasslion
        3
    glasslion  
       Aug 16, 2019
    你的任务是要延时很久才执行的吧, 超过了了这个 visibility_timeout(30 分钟)? 如果是的话, 目前无解
    smallpython
        4
    smallpython  
    OP
       Aug 16, 2019
    @glasslion 不延时,立即执行

    我初步排查,是因为 worker 认为任务执行失败了,又执行了一次,导致执行两次

    但是任务并没有失败,所以会存储两份结果
    cz5424
        5
    cz5424  
       Aug 16, 2019 via iPhone
    @smallpython 一般不会重试的,除非手动设定,立即执行的任务一般不会被重复发,看看是不是设置了相同的 worker 名字?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   829 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 22:37 · PVG 06:37 · LAX 15:37 · JFK 18:37
    ♥ Do have faith in what you're doing.