规范了update data的构建方式,统一使用build_update_request_data方法来处理更新数据的构建和过滤逻辑。这个方法会根据提供的原始数据、更新数据和对应的schema来生成最终的更新请求数据,同时会自动排除掉未变化的字段和空值字段,从而确保只发送必要的更新信息到后端接口。这种方式不仅简化了代码逻辑,还提高了代码的可维护性和一致性。
This commit is contained in:
@@ -264,6 +264,7 @@ def _build_strategies(
|
||||
if runtime_cfg is not None:
|
||||
strategy.set_config(runtime_cfg.config.model_copy(deep=True))
|
||||
strategy.skip_sync = bool(runtime_cfg.skip_sync)
|
||||
strategy.skip_post_check = bool(runtime_cfg.skip_post_check)
|
||||
|
||||
strategies.append(strategy)
|
||||
return strategies
|
||||
|
||||
@@ -509,8 +509,22 @@ class FullSyncPipeline:
|
||||
else:
|
||||
self._logger.info("🔄 Post-check: reloading all node types for final consistency evaluation...")
|
||||
for node_type in self.node_types:
|
||||
strategy = next((item for item in self.strategies if item.node_type == node_type), None)
|
||||
if strategy is not None and strategy.skip_post_check:
|
||||
self._logger.info("⏭️ Post-check reload skipped: node_type=%s", node_type)
|
||||
continue
|
||||
await self._reload_node_type(node_type, reason="post-check final reload")
|
||||
for node_type in self.node_types:
|
||||
strategy = next((item for item in self.strategies if item.node_type == node_type), None)
|
||||
if strategy is not None and strategy.skip_post_check:
|
||||
self._logger.info("⏭️ Post-check skipped: node_type=%s", node_type)
|
||||
self._consistency_by_type[node_type] = {
|
||||
"ok": True,
|
||||
"checked_pairs": 0,
|
||||
"mismatch_count": 0,
|
||||
"skipped": True,
|
||||
}
|
||||
continue
|
||||
await self._evaluate_consistency_for_node_type(node_type)
|
||||
|
||||
self.stats["consistency"] = {
|
||||
|
||||
Reference in New Issue
Block a user