mirror of
				https://github.com/songquanpeng/one-api.git
				synced 2025-11-04 15:53:42 +08:00 
			
		
		
		
	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 <songquanpeng@foxmail.com>
This commit is contained in:
		@@ -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
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user