From 1a394ddd2b09f41ad3b80410894a034780c86b7c Mon Sep 17 00:00:00 2001 From: root Date: Tue, 28 Apr 2026 20:56:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=5Finit=5Fgraph=20=E6=9B=B4=E6=96=B0=20?= =?UTF-8?q?=5Fdb=5Fpath=20=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7=E9=9A=94?= =?UTF-8?q?=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题: - _init_graph 正确解析了用户 DB 路径,但未更新 self._db_path - web_api.py 的 create_server() 用 backend_server._db_path 创建 graph_db - 导致所有用户共用一个 CWD/graph_memory.db(回忆图谱页面数据混在一起) - 同时 jianf 的 config.json 首次创建时空 apikey,未正确写回 修复: - _init_graph 解析用户路径后,同步更新 self._db_path - 现在各用户 graph_db 和 config.json 完全隔离 --- core/server.py | 1 + 1 file changed, 1 insertion(+) diff --git a/core/server.py b/core/server.py index 1350b64..651c763 100644 --- a/core/server.py +++ b/core/server.py @@ -217,6 +217,7 @@ class BackendServer: temp_db.close() if user_info and user_info.get('db_path'): db_path = user_info['db_path'] + self._db_path = db_path # 更新 _db_path,供外部(如 web_api.py)获取正确的路径 except Exception: pass # 如果获取失败,使用默认路径