Flask Gunicorn 不应用我的新代码更改

hon*_*ute 5 flask python-3.x gunicorn

我正在开发一个 Flask webapp,在开发过程中我使用run.py.

运行.py:

from my_app import app
from my_app.config import (WEBSERVER_PORT)


if __name__ == '__main__':
    app.run(host='0.0.0.0', port=WEBSERVER_PORT, debug=True)
Run Code Online (Sandbox Code Playgroud)

但是,我计划在生产中使用 gunicorn 为我的应用程序提供服务,并且当我使用 gunicorn 运行该应用程序时,我看到了性能下降。例如,我向我的 web 应用程序添加了一个新按钮,但我只能看到run.py用于运行该应用程序的新按钮。但是当我使用 gunicorn 为我的应用程序提供这样的服务时:

gunicorn --bind 0.0.0.0:8000 wsgi
Run Code Online (Sandbox Code Playgroud)

该应用程序运行没有错误,但是,我没有看到新按钮。这是我的 wsgi.py:

from my_app import app as application

if __name__ == "__main__":
    application.run()
Run Code Online (Sandbox Code Playgroud)

这是我的服务方式:

(venv)# gunicorn --bind 0.0.0.0:8000 wsgi
[2018-11-19 10:35:52 -0800] [16644] [INFO] Starting gunicorn 19.9.0
[2018-11-19 10:35:52 -0800] [16644] [INFO] Listening at: http://0.0.0.0:8000 (16644)
[2018-11-19 10:35:52 -0800] [16644] [INFO] Using worker: sync
[2018-11-19 10:35:52 -0800] [16647] [INFO] Booting worker with pid: 16647
Run Code Online (Sandbox Code Playgroud)

所以我的问题是,Gunicorn 是否缓存了您的任何更改,因为在使用 gunicorn 时我只能看到我的旧代码。或者在使用 Gunicorn 运行它之前,我需要做些什么来获得新的更改?