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

django-celery-beat-->Crontab 及 Clocked 不执行问题

  •  
  •   5TuNan · Mar 30, 2020 · 4016 views
    This topic created in 2370 days ago, the information mentioned may be changed or developed.

    如题,最近在使用 django-celery-beat,在使用中发现 IntervalSchedule 可正常使用。但是 Crontab 及 Clocked 却不执行,也没有任何报错。有没有大佬遇到过这种问题,怎么解决的。

    现在根据 github 问题尝试解决过,依然没什么用。 https://github.com/celery/celery/issues/4184

    Celery Settings
    CELERY_BROKER_URL = 'redis://localhost:6379/1' 
    CELERY_RESULT_BACKEND = 'django-db'
    CELERY_TIMEZONE = 'Asia/Shanghai'
    CELERY_ENABLE_UTC = False
    CELERY_WORKER_CONCURRENCY = 99 
    CELERY_ACKS_LATE = True
    CELERY_WORKER_MAX_TASKS_PER_CHILD = 5
    CELERY_TASK_TIME_LIMIT = 15 * 60
    CELERY_BEAT_SCHEDULER = 'django_celery_beat.schedulers:DatabaseScheduler'
    DJANGO_CELERY_BEAT_TZ_AWARE = False
    
    3 replies  •  2020-03-31 09:19:36 +08:00
    wuwukai007
        1
    wuwukai007  
       Mar 30, 2020
    是 django-celery 还是 celery,
    pl01665077
        2
    pl01665077  
       Mar 30, 2020
    我估计是时区的配置问题。CELERY 时区和 Django 时区还有 django-celery-beat 时区。比如如果存数据的是 UTC 时区但读取是取东八区时区,那么可能延迟了 8 小时才执行。
    5TuNan
        3
    5TuNan  
    OP
       Mar 31, 2020
    @pl01665077 我 Django 的时区`TIME_ZONE = 'Asia/Shanghai'``USE_TZ = False`,与 Celery 保持一致的。但还是无法执行😂。


    @wuwukai007 感谢白送的 5 铜币。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2580 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 05:59 · PVG 13:59 · LAX 22:59 · JFK 01:59
    ♥ Do have faith in what you're doing.