From b3e6c7a6186da6e715fe53e530840e230c969329 Mon Sep 17 00:00:00 2001 From: liailing1026 <1815388873@qq.com> Date: Thu, 29 Jan 2026 16:40:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E9=83=A8=E7=BD=B2=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/requirements.txt | 1 + backend/server.py | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/requirements.txt b/backend/requirements.txt index 9064092..2707c9c 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -7,3 +7,4 @@ mistralai==0.1.6 flask-socketio==5.3.6 python-socketio==5.11.0 simple-websocket==1.0.0 +eventlet==0.40.4 \ No newline at end of file diff --git a/backend/server.py b/backend/server.py index 1f603ec..3a29920 100644 --- a/backend/server.py +++ b/backend/server.py @@ -26,7 +26,7 @@ try: with open(yaml_file, "r", encoding="utf-8") as file: yaml_data = yaml.safe_load(file) except Exception: - yaml_file = {} + yaml_data = {} USE_CACHE: bool = os.getenv("USE_CACHE") if USE_CACHE is None: USE_CACHE = yaml_data.get("USE_CACHE", False) @@ -37,7 +37,8 @@ AgentProfile_Dict = {} Request_Cache: dict[str, str] = {} app = Flask(__name__) app.config['SECRET_KEY'] = 'agentcoord-secret-key' -socketio = SocketIO(app, cors_allowed_origins="*", async_mode='threading') +# socketio = SocketIO(app, cors_allowed_origins="*", async_mode='threading') +socketio = SocketIO(app, cors_allowed_origins="*", async_mode='eventlet') def truncate_rehearsal_log(RehearsalLog: List, restart_from_step_index: int) -> List: @@ -1767,4 +1768,5 @@ if __name__ == "__main__": args = parser.parse_args() init() # 使用 socketio.run 替代 app.run,支持WebSocket - socketio.run(app, host="0.0.0.0", port=args.port, debug=True, allow_unsafe_werkzeug=True) + # socketio.run(app, host="0.0.0.0", port=args.port, debug=True, allow_unsafe_werkzeug=True) + socketio.run(app, host="0.0.0.0", port=args.port, debug=False, allow_unsafe_werkzeug=True)