static: 切换 fsys.py 到 Waitress WSGI 服务器
- HTTP 场景使用 waitress.serve(threads=8) 替代 Flask 开发服务器 - SSL 场景回退 Flask 内置服务器(Waitress 不支持 TLS) - requirements.txt 新增 waitress 依赖
This commit is contained in:
1 parent
f0cdaacd85
commit
f9cf408c82
2 files changed
+5
-1
No files matched your search
+4
-1
@@ -582,6 +582,9 @@ if __name__ == '__main__':
|
||||
print("\n")
|
||||
|
||||
if SSL_ENABLED and os.path.exists(SSL_CERT_FILE) and os.path.exists(SSL_KEY_FILE):
|
||||
# Waitress 不支持 TLS,SSL 场景回退到 Flask 内置服务器
|
||||
logger.warning("SSL enabled: falling back to Flask built-in server (Waitress has no TLS support)")
|
||||
app.run(host=host, port=port, ssl_context=(SSL_CERT_FILE, SSL_KEY_FILE), debug=False)
|
||||
else:
|
||||
app.run(host=host, port=port, debug=False)
|
||||
from waitress import serve
|
||||
serve(app, host=host, port=port, threads=8)
|
||||
@@ -2,3 +2,4 @@
|
||||
nuitka
|
||||
Flask>=2.3.0,<3.0.0
|
||||
Flask-CORS>=4.0.0,<5.0.0
|
||||
waitress>=2.1.2,<4.0.0
|
||||
Reference in new issue
Block a user