调整了pipeline执行顺序。现在按domain顺序读取数据源数据,防止前面domain的更新影响后面domain.

将target_project_ids替换为更通用的data_id_filter
This commit is contained in:
strepsiades
2026-03-20 14:38:56 +08:00
parent f9f175ee79
commit 2c09c61165
29 changed files with 296 additions and 172 deletions
@@ -71,26 +71,11 @@ class ProjectApiHandler(BaseApiHandler):
# 类级别缓存:存储 all_info 数据
_all_info_cache: Dict[str, Dict[str, Any]] = {}
def __init__(self, filter_project_id: str | List[str] | None = None):
"""
初始化 Project Handler
Args:
filter_project_id: 指定只加载的项目ID列表(可选,用于多项目测试)
"""
def __init__(self):
super().__init__()
self._node_type = "project"
self._node_class = ProjectSyncNode
self._schema = ProjectResponseBase
if filter_project_id is None:
self._filter_project_id = None
elif isinstance(filter_project_id, str):
self._filter_project_id = [filter_project_id]
else:
self._filter_project_id = filter_project_id # 保存过滤条件
def set_target_project_ids(self, target_project_ids: List[str]) -> None:
self._filter_project_id = list(target_project_ids) if target_project_ids else None
@classmethod
async def get_all_info(cls, client, project_id: str) -> Dict[str, Any]:
@@ -127,15 +112,12 @@ class ProjectApiHandler(BaseApiHandler):
nodes = []
# 确定要加载的项目ID列表:参数 > 构造函数配置
target_project_ids = self._filter_project_id or []
if isinstance(target_project_ids, str):
target_project_ids = [target_project_ids]
project_id_filter = self.get_data_id_filter()
if target_project_ids:
if project_id_filter:
# 只加载指定项目列表
projects : List[ProjectResponseBase]= []
for project_id in target_project_ids:
for project_id in project_id_filter:
project_response = await api_get_project(self.api_client, project_id)
projects.append(project_response)
else: