Просмотр исходного кода

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 <[email protected]>
mrhaoji 2 лет назад
Родитель
Сommit
f0dc7f3f06
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      model/cache.go

+ 1 - 1
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
 	}