fix(fulfillment): 修正直播账号履约绑定与取消流程

- 按活动 alias 与 cjm 双角色快照建立绑定 baseline,避免旧角色被误判为本次扫码
- 确认绑定任务固化目标角色,禁止回退确认旧角色
- 绑定失败状态优先于旧待确认标记,并支持客服重置客户角色资料
- 取消任务改为终态幂等操作,停止关联批次并默认释放账号和租约
- 补充双角色选择、重置绑定和取消释放账号测试
This commit is contained in:
yml
2026-11-18 10:59:20 +08:00
parent 8ba6379687
commit 1abc0dfdce
9 changed files with 698 additions and 36 deletions
+13 -1
View File
@@ -37,4 +37,16 @@ def start_douyu_batch(
threading.Thread(target=runner.run, daemon=True).start()
__all__ = ["start_douyu_batch"]
def stop_douyu_batches(batch_ids: list[str]) -> int:
"""向仍在运行的批次发送停止信号,返回实际命中的批次数。"""
stopped = 0
for batch_id in dict.fromkeys(value for value in batch_ids if value):
batch = douyu_batch_registry.get(batch_id)
if not batch or batch.get("finished"):
continue
batch["runner"].stop()
stopped += 1
return stopped
__all__ = ["start_douyu_batch", "stop_douyu_batches"]