""" 生产环境启动脚本 使用 waitress 作为 WSGI 服务器 """ import os from waitress import serve from app import app if __name__ == '__main__': port = int(os.environ.get('DEPLOY_RUN_PORT', 5000)) host = os.environ.get('DEPLOY_RUN_HOST', '0.0.0.0') print(f'订单日报系统 - 生产模式') print(f'监听地址: {host}:{port}') print('按 Ctrl+C 停止服务') print('-' * 50) serve( app, host=host, port=port, threads=8, connection_limit=200, channel_timeout=300, )