docs(v2): Router.Pick 注明 weighted 桶序绑定 config 账户声明顺序(reorder=repin)

This commit is contained in:
wangjia
2026-07-10 13:56:03 +08:00
parent bd50a0d561
commit 381288e707
+3
View File
@@ -37,6 +37,9 @@ func (r *Router) strategyFor(channel string) Strategy {
}
// Pick 实现 accounts.Picker。
// 注:cands 顺序 = EnabledFor 保留的 config.Accounts 声明顺序,原样传给策略——
// weighted 的桶按候选顺序累加边界(见 weighted.go),故 config.yaml 里账户顺序变了
// 等价于重新分桶(reorder = repin),同一 OutTradeNo 命中的账户可能跟着变,不是 bug。
func (r *Router) Pick(channel, region string, hint PickHint) (config.AccountConfig, error) {
cands := r.reg.EnabledFor(channel, region)
if len(cands) == 0 {