From f0dc7f3f06f816685884bf83a876b45c0dcdede8 Mon Sep 17 00:00:00 2001 From: mrhaoji Date: Sun, 25 Jun 2023 23:14:15 +0800 Subject: [PATCH] fix: InitChannelCache does not filter disabled channels (#201) * chore: Show the HTTP status code in the test_time script to determine the success or failure of the request. * fix: InitChannelCache does not filter disabled channels * chore: do not hardcode --------- Co-authored-by: JustSong --- model/cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/cache.go b/model/cache.go index 82841d24..e25b64f4 100644 --- a/model/cache.go +++ b/model/cache.go @@ -108,7 +108,7 @@ var channelSyncLock sync.RWMutex func InitChannelCache() { newChannelId2channel := make(map[int]*Channel) var channels []*Channel - DB.Find(&channels) + DB.Where("status = ?", common.ChannelStatusEnabled).Find(&channels) for _, channel := range channels { newChannelId2channel[channel.Id] = channel }