增加指纹随机
This commit is contained in:
@@ -1385,8 +1385,8 @@ const maxTempDeadAccounts = 3
|
|||||||
// - tempFailover=false (default): retry the SAME account up to
|
// - tempFailover=false (default): retry the SAME account up to
|
||||||
// maxSameAccountAttempts times (not counted); if still failing, STOP
|
// maxSameAccountAttempts times (not counted); if still failing, STOP
|
||||||
// (no fan-out — an upstream-wide blip fails identically everywhere).
|
// (no fan-out — an upstream-wide blip fails identically everywhere).
|
||||||
// - tempFailover=true (adobe): fail over to the next account WITHOUT
|
// - tempFailover=true (adobe): disable+mark the account dead and fail over
|
||||||
// penalizing this one (rate-limit/overload isn't the account's fault),
|
// to the next account (ops policy: shed accounts that hit upstream errors),
|
||||||
// capped at maxTempDeadAccounts accounts so a pool-wide blip can't fan
|
// capped at maxTempDeadAccounts accounts so a pool-wide blip can't fan
|
||||||
// a single request out across everything.
|
// a single request out across everything.
|
||||||
// - 参数错 / request-level (anything else) → return immediately, no retry, no
|
// - 参数错 / request-level (anything else) → return immediately, no retry, no
|
||||||
@@ -1494,16 +1494,12 @@ func (s *V1Service) tryAccount(ctx context.Context, eventID, pool string, token
|
|||||||
}
|
}
|
||||||
if isTemp {
|
if isTemp {
|
||||||
if tempFailover {
|
if tempFailover {
|
||||||
// Ops policy (adobe): a temporary upstream error ("system under
|
// Ops policy (adobe): treat a temporary upstream error the same as
|
||||||
// load" / rate-limit) is NOT the account's fault — record the
|
// a fatal one — disable+mark the account dead and fail over to the
|
||||||
// failure but keep the account active, and fail over to the next
|
// next. The pool driver caps how many accounts one request may burn
|
||||||
// account. The pool driver caps how many accounts one request may
|
// this way (maxTempDeadAccounts) so a pool-wide blip can't fan a
|
||||||
// burn this way (maxTempDeadAccounts).
|
// single request across the whole pool in one shot.
|
||||||
_, _ = s.tokens.Update(ctx, pool, token.ID, map[string]any{
|
s.markTokenDead(ctx, pool, token, kind)
|
||||||
"last_used_at": time.Now(),
|
|
||||||
"fail_total": gorm.Expr("fail_total + 1"),
|
|
||||||
"fails": gorm.Expr("fails + 1"),
|
|
||||||
})
|
|
||||||
return nil, err, true, true
|
return nil, err, true, true
|
||||||
}
|
}
|
||||||
tempAttempts++
|
tempAttempts++
|
||||||
|
|||||||
Reference in New Issue
Block a user