feat: switch priority when retry (close #1048)

This commit is contained in:
JustSong
2024-03-03 22:14:07 +08:00
parent 9d8967f7d3
commit 2df877a352
4 changed files with 16 additions and 3 deletions

View File

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