这是一个创建于 2600 天前的主题,其中的信息可能已经有所发展或是发生改变。
看过官方的文档,关于--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
|
|
1
janxin 2017-08-30 21:10:01 +08:00
The reloader is incompatible with application preloading.
|