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
kingofvir
V2EX  ›  Python

celery 时间段内秒级任务执行

  •  
  •   kingofvir · 2019-05-10 11:49:29 +08:00 · 3370 次点击
    这是一个创建于 1784 天前的主题,其中的信息可能已经有所发展或是发生改变。

    cdlery 如设在工作日朝九晚五时间段内,每 30 秒执行一次任务?

    11 条回复    2019-05-14 16:58:52 +08:00
    est
        1
    est  
       2019-05-10 12:02:51 +08:00
    都 30 秒了。自己写个 sleep 吧。不要 celery 了。
    kingofvir
        2
    kingofvir  
    OP
       2019-05-10 12:06:05 +08:00
    @est 间隔太短了么?
    Philippa
        3
    Philippa  
       2019-05-10 14:11:20 +08:00 via iPhone
    简单的固定时间固定任务话内部用 rpc 就好了,触发然后执行,写个异步线程就行了。while true 非常可靠,没必要 Celery 高射炮打蚊子。一般我都是遇到大的项目才用 Celery 配合 Airflow.
    Gakho
        4
    Gakho  
       2019-05-10 15:53:01 +08:00
    可以了解一下 apscheduler
    xiongbiao
        5
    xiongbiao  
       2019-05-10 19:03:40 +08:00
    可以看看 celery beat
    tikazyq
        6
    tikazyq  
       2019-05-10 21:08:59 +08:00
    apscheduler
    RickyHao
        7
    RickyHao  
       2019-05-10 23:52:28 +08:00 via Android
    celery beat,schedule
    harpy
        8
    harpy  
       2019-05-11 00:29:21 +08:00
    记得 celery 自带 cron 的组建吧。。
    snip
        9
    snip  
       2019-05-11 10:46:56 +08:00
    sleep 30
    kimiichan
        10
    kimiichan  
       2019-05-11 21:01:52 +08:00
    celery beat add_periodic_task 或 linux crontab
    kingofvir
        11
    kingofvir  
    OP
       2019-05-14 16:58:52 +08:00
    @harpy cron 的组件最小单位似乎是分
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1311 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 17:47 · PVG 01:47 · LAX 10:47 · JFK 13:47
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.