Commit b973d927 by Calcium-Ion Committed by GitHub

Merge pull request #631 from xqx333/main

fix
parents a3bb88c2 85145724
......@@ -296,10 +296,15 @@ func UpdateChannelStatusById(id int, status int, reason string) {
if (common.MemoryCacheEnabled) {
channelStatusLock.Lock()
channelCache, err := CacheGetChannel(id)
// 如果缓存渠道不存在或渠道已是目标状态,直接返回
if err != nil || channelCache.Status == status {
// 如果缓存渠道存在,且状态已是目标状态,直接返回
if channelCache != nil && channelCache.Status == status {
channelStatusLock.Unlock()
return
return
}
// 如果缓存渠道不存在(说明已经被禁用),且要设置的状态不为启用,直接返回
if channelCache == nil && status != common.ChannelStatusEnabled {
channelStatusLock.Unlock()
return
}
CacheUpdateChannelStatus(id, status)
channelStatusLock.Unlock()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment