fix(fulfillment): reconcile stale pending roles from newer observations

This commit is contained in:
yml
2026-11-23 22:57:49 +08:00
parent e6629a9c91
commit 23c4b93e9c
9 changed files with 586 additions and 14 deletions
+9
View File
@@ -140,6 +140,9 @@ def recover_orphaned_work() -> None:
cleanup_orphan_login_tasks,
cleanup_orphan_relogin_tasks,
)
from .services.platform_fulfillment.service import (
reconcile_binding_observations,
)
from .services.yyb_service import cleanup_orphan_yyb_tasks
db = SessionLocal()
@@ -180,6 +183,12 @@ def recover_orphaned_work() -> None:
recovered_work = recover_running_account_work(db)
if recovered_work:
logger.info("启动恢复中断的账号内部工作项: {} 条", recovered_work)
reconciled_bindings = reconcile_binding_observations(db)
if reconciled_bindings:
logger.info(
"启动收敛账号角色观测到履约任务: {} 条",
reconciled_bindings,
)
seeded_targets = ensure_default_supply_targets(db)
if seeded_targets:
logger.info("已建立默认账号供给目标: {} 条", seeded_targets)