feat: sync deployed v1.0.0-rc.38-custom.67

This commit is contained in:
cneicy committed 2026-10-06 00:07:10 +08:00
1 parent d09216bbde
commit 8e6ed0317b
154 files changed
+39540 -20509

No files matched your search

+17 -4
View File
@@ -269,7 +269,14 @@ func selectFromGroupPool(param *RetryParam, tiers []groupPoolTier, filters []dto
// Retry=3: GroupB, priority1 (startRetryIndex=2, priorityRetry=1)
// 分组B, 优先级1
func CacheGetRandomSatisfiedChannel(param *RetryParam) (*model.Channel, string, error) {
if RequestRoutingPolicy(param.Ctx) != nil { return selectTokenRoutingPool(param) }
if RequestRoutingPolicy(param.Ctx) != nil {
return selectTokenRoutingPool(param)
}
if group := imageGenerationRequestGroup(param.Ctx, param.ModelName); group != "" {
channel, err := selectWithTrace(param, group, param.GetRetry())
common.SetContextKey(param.Ctx, constant.ContextKeyAutoGroup, group)
return channel, group, err
}
var channel *model.Channel
var err error
selectGroup := param.TokenGroup
@@ -488,10 +495,16 @@ func SelectChannelForRequest(c *gin.Context, modelName string, retry *RetryParam
usingGroup := retry.TokenGroup
if RequestRoutingPolicy(c) != nil {
if channel, group := PreferredPoolChannel(c, modelName); channel != nil && retry.GetRetry() == 0 { return channel,group,nil }
if retry.GetRetry() == 0 {
if channel, group := PreferredPoolChannel(c, modelName); channel != nil {
return channel, group, nil
}
}
channel, group, err := selectTokenRoutingPool(retry)
if err != nil || channel == nil { return nil,group,&ChannelSelectError{StatusCode:http.StatusServiceUnavailable,Code:types.ErrorCodeModelNotFound,Message:"No eligible channel in the group pool",NoAvailableChannel:true} }
return channel,group,nil
if err != nil || channel == nil {
return nil, group, &ChannelSelectError{StatusCode: http.StatusServiceUnavailable, Code: types.ErrorCodeModelNotFound, Message: "No eligible channel in the group pool", NoAvailableChannel: true}
}
return channel, group, nil
}
var channel *model.Channel
var selectGroup string