docs(v2): Router.Pick 注明 weighted 桶序绑定 config 账户声明顺序(reorder=repin)
This commit is contained in:
@@ -37,6 +37,9 @@ func (r *Router) strategyFor(channel string) Strategy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Pick 实现 accounts.Picker。
|
// 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) {
|
func (r *Router) Pick(channel, region string, hint PickHint) (config.AccountConfig, error) {
|
||||||
cands := r.reg.EnabledFor(channel, region)
|
cands := r.reg.EnabledFor(channel, region)
|
||||||
if len(cands) == 0 {
|
if len(cands) == 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user