mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-18 20:30:51 +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.
|
// RoutingConfig configures how credentials are selected for requests.
|
||||||
type RoutingConfig struct {
|
type RoutingConfig struct {
|
||||||
// Strategy selects the credential selection strategy.
|
// 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"`
|
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.
|
// NewManager constructs a manager with optional custom selector and hook.
|
||||||
func NewManager(store Store, selector Selector, hook Hook) *Manager {
|
func NewManager(store Store, selector Selector, hook Hook) *Manager {
|
||||||
if selector == nil {
|
if selector == nil {
|
||||||
selector = &FillFirstSelector{}
|
selector = &RoundRobinSelector{}
|
||||||
}
|
}
|
||||||
if hook == nil {
|
if hook == nil {
|
||||||
hook = NoopHook{}
|
hook = NoopHook{}
|
||||||
|
|||||||
@@ -205,10 +205,10 @@ func (b *Builder) Build() (*Service, error) {
|
|||||||
}
|
}
|
||||||
var selector coreauth.Selector
|
var selector coreauth.Selector
|
||||||
switch strategy {
|
switch strategy {
|
||||||
case "round-robin", "roundrobin", "rr":
|
case "fill-first", "fillfirst", "ff":
|
||||||
selector = &coreauth.RoundRobinSelector{}
|
|
||||||
default:
|
|
||||||
selector = &coreauth.FillFirstSelector{}
|
selector = &coreauth.FillFirstSelector{}
|
||||||
|
default:
|
||||||
|
selector = &coreauth.RoundRobinSelector{}
|
||||||
}
|
}
|
||||||
|
|
||||||
coreManager = coreauth.NewManager(tokenStore, selector, nil)
|
coreManager = coreauth.NewManager(tokenStore, selector, nil)
|
||||||
|
|||||||
Reference in New Issue
Block a user