fix: 修复渠道一致性问题

This commit is contained in:
CaIon
2024-01-12 14:34:44 +08:00
parent febcadb42c
commit e2a1caba4c
3 changed files with 5 additions and 2 deletions

View File

@@ -258,8 +258,8 @@ func CacheGetRandomSatisfiedChannel(group string, model string) (*Channel, error
return channel, nil
}
}
// return the last channel if no channel is found
return channels[endIdx-1], nil
// return null if no channel is not found
return nil, errors.New("channel not found")
}
func CacheGetChannel(id int) (*Channel, error) {