mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-19 21:00:52 +08:00
fix: keep round-robin as default routing
This commit is contained in:
@@ -130,7 +130,7 @@ type QuotaExceeded struct {
|
||||
// RoutingConfig configures how credentials are selected for requests.
|
||||
type RoutingConfig struct {
|
||||
// Strategy selects the credential selection strategy.
|
||||
// Supported values: "fill-first" (default), "round-robin".
|
||||
// Supported values: "round-robin" (default), "fill-first".
|
||||
Strategy string `yaml:"strategy,omitempty" json:"strategy,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ type Manager struct {
|
||||
// NewManager constructs a manager with optional custom selector and hook.
|
||||
func NewManager(store Store, selector Selector, hook Hook) *Manager {
|
||||
if selector == nil {
|
||||
selector = &FillFirstSelector{}
|
||||
selector = &RoundRobinSelector{}
|
||||
}
|
||||
if hook == nil {
|
||||
hook = NoopHook{}
|
||||
|
||||
@@ -205,10 +205,10 @@ func (b *Builder) Build() (*Service, error) {
|
||||
}
|
||||
var selector coreauth.Selector
|
||||
switch strategy {
|
||||
case "round-robin", "roundrobin", "rr":
|
||||
selector = &coreauth.RoundRobinSelector{}
|
||||
default:
|
||||
case "fill-first", "fillfirst", "ff":
|
||||
selector = &coreauth.FillFirstSelector{}
|
||||
default:
|
||||
selector = &coreauth.RoundRobinSelector{}
|
||||
}
|
||||
|
||||
coreManager = coreauth.NewManager(tokenStore, selector, nil)
|
||||
|
||||
Reference in New Issue
Block a user