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

flask 部署中 gunicorn 的参数--reload 和 --preload 有点不明白的地方

  •  
  •   louzhumuyou · 2017-08-30 16:22:58 +08:00 · 5933 次点击
    这是一个创建于 2431 天前的主题,其中的信息可能已经有所发展或是发生改变。
    看过官方的文档,关于--reload 和--preload 有些不太了解的地方,我的启动服务的全命令是 gunicorn --b xxxxx --workers 3 wsgi:application --preload --reload

    这里的--preload 是因为我的服务中有有一个后台定时的任务,是用 BackgroundScheduler 设置的,类似于 cron 的形式,但是我希望只有一个 worker 会启用,故而增加了 preload 参数,增加--reload 是为了检测到 code 变化自动重启服务,但是我现在验证了当代码变更时候,虽然后台显示已经服务重启,但是实际并没有效果,是因为这里的--preload 造成的吗?但是如果我不加这个参数,该如何实现,只有一个 worker 执行 Scheduler 呢?
    2 条回复    2017-08-31 13:33:15 +08:00
    janxin
        1
    janxin  
       2017-08-30 21:10:01 +08:00
    The reloader is incompatible with application preloading.
    louzhumuyou
        2
    louzhumuyou  
    OP
       2017-08-31 13:33:15 +08:00
    @janxin 不兼容,那有什么好着吗
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1017 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 22:56 · PVG 06:56 · LAX 15:56 · JFK 18:56
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.