fix: InitChannelCache does not filter disabled channels

This commit is contained in:
mrhaoji 2023-06-25 22:58:20 +08:00 committed by GitHub
parent 01cef64a5d
commit 248ad68d45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,7 +108,7 @@ var channelSyncLock sync.RWMutex
func InitChannelCache() {
newChannelId2channel := make(map[int]*Channel)
var channels []*Channel
DB.Find(&channels)
DB.Where("status = ?", 1).Find(&channels)
for _, channel := range channels {
newChannelId2channel[channel.Id] = channel
}