fix: 修复渠道一致性问题

This commit is contained in:
CaIon committed 2024-01-12 14:36:15 +08:00
1 parent aa8b722a13
commit 0266cf4b7e
3 files changed
+5 -2

No files matched your search

+1
View File
@@ -159,5 +159,6 @@ func FixAbility() (int, error) {
count++
}
}
InitChannelCache()
return count, nil
}
+2 -2
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) {