feat: only use the top priority when first retry (#1048)

This commit is contained in:
JustSong 2024-03-03 22:16:34 +08:00
parent 2df877a352
commit 10a926b8f3

View File

@ -62,7 +62,7 @@ func Relay(c *gin.Context) {
retryTimes = 0 retryTimes = 0
} }
for i := retryTimes; i > 0; i-- { for i := retryTimes; i > 0; i-- {
channel, err := dbmodel.CacheGetRandomSatisfiedChannel(group, originalModel, true) channel, err := dbmodel.CacheGetRandomSatisfiedChannel(group, originalModel, i != retryTimes)
if err != nil { if err != nil {
logger.Errorf(ctx, "CacheGetRandomSatisfiedChannel failed: %w", err) logger.Errorf(ctx, "CacheGetRandomSatisfiedChannel failed: %w", err)
break break