feat(sniper): 增加1.5s快速超时熔断,重构角色未绑定分类解绑会话失效
- 兑换请求增加独立的 RequestTimeout 上下文超时熔断(默认 1500ms),防止微服务卡死吃掉 5 秒 - 剥离 CategoryRoleUnbound(角色未绑定/抖动),不再计入 sessionStreak 判死阈值,杜绝误杀有效账号 - 将 CategoryRoleUnbound 与 CategoryTooFrequent 纳入 sessionAliveCategory,正常回包可重置会话计数 - 补充单测 TestRunTargetsRoleUnboundDoesNotStopAccount 与 TestExchangeTargetFastTimeout
This commit is contained in:
@@ -233,7 +233,7 @@ func (r *Runner) runAccountRound(ctx context.Context, client huya.ActivityClient
|
||||
state.emitSkippedDuplicate(emit, round, account.UID, index, int64(target.PID), target)
|
||||
continue
|
||||
}
|
||||
result := r.exchangeTarget(ctx, client, state, account, target, index, round, cfg.SID, nil)
|
||||
result := r.exchangeTarget(ctx, client, state, account, target, index, round, cfg.SID, nil, cfg.RequestTimeout)
|
||||
if result.Action == actionExchangeCanceled {
|
||||
return finish()
|
||||
}
|
||||
@@ -309,7 +309,7 @@ func (r *Runner) runAccountRound(ctx context.Context, client huya.ActivityClient
|
||||
state.emitSkippedDuplicate(emit, round, account.UID, index, prize.ID, target)
|
||||
continue
|
||||
}
|
||||
result := r.exchangeTarget(ctx, client, state, account, target, index, round, cfg.SID, prize)
|
||||
result := r.exchangeTarget(ctx, client, state, account, target, index, round, cfg.SID, prize, cfg.RequestTimeout)
|
||||
if result.Action == actionExchangeCanceled {
|
||||
return finish()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user