From 8c6f395818320b95ed2c00ba2b44f85292392fb9 Mon Sep 17 00:00:00 2001 From: Ke Sun Date: Thu, 26 Mar 2026 16:36:53 +0800 Subject: [PATCH] refactor(app-service): Rename memory config extraction method for clarity - Rename `_extract_memory_config_id` to `_get_memory_config_id_from_release` to better reflect its purpose of retrieving memory config from release objects - Update method call in release creation flow - Update method call in release retrieval flow - Improves code readability by making the method's scope and responsibility more explicit --- api/app/services/app_service.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/app/services/app_service.py b/api/app/services/app_service.py index 19aaac42..4dcabff8 100644 --- a/api/app/services/app_service.py +++ b/api/app/services/app_service.py @@ -1638,7 +1638,7 @@ class AppService: # ==================== 记忆配置提取方法 ==================== - def _extract_memory_config_id( + def _get_memory_config_id_from_release( self, app_type: str, config: Dict[str, Any] @@ -1863,7 +1863,7 @@ class AppService: self.db.flush() # 先 flush,确保 release 已插入数据库 # 提取记忆配置ID并更新终端用户 - memory_config_id, is_legacy_int = self._extract_memory_config_id(app.type, config) + memory_config_id, is_legacy_int = self._get_memory_config_id_from_release(app.type, config) # 如果检测到旧格式 int 数据,回退到工作空间默认配置 if is_legacy_int and not memory_config_id: @@ -2001,7 +2001,7 @@ class AppService: raise ResourceNotFoundException("发布版本", f"app_id={app_id}, version={version}") # 提取记忆配置ID并更新终端用户 - memory_config_id, is_legacy_int = self._extract_memory_config_id(release.type, release.config) + memory_config_id, is_legacy_int = self._get_memory_config_id_from_release(release.type, release.config) # 如果检测到旧格式 int 数据,回退到工作空间默认配置 if is_legacy_int and not memory_config_id: