Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b973d927
authored
Dec 17, 2024
by
Calcium-Ion
Committed by
GitHub
Dec 17, 2024
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #631 from xqx333/main
fix
parents
a3bb88c2
85145724
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
model/channel.go
+8
-3
No files found.
model/channel.go
View file @
b973d927
...
@@ -296,10 +296,15 @@ func UpdateChannelStatusById(id int, status int, reason string) {
...
@@ -296,10 +296,15 @@ func UpdateChannelStatusById(id int, status int, reason string) {
if
(
common
.
MemoryCacheEnabled
)
{
if
(
common
.
MemoryCacheEnabled
)
{
channelStatusLock
.
Lock
()
channelStatusLock
.
Lock
()
channelCache
,
err
:=
CacheGetChannel
(
id
)
channelCache
,
err
:=
CacheGetChannel
(
id
)
// 如果缓存渠道
不存在或渠道已是目标状态,直接返回
// 如果缓存渠道
存在,且状态已是目标状态,直接返回
if
err
!=
nil
||
channelCache
.
Status
==
status
{
if
channelCache
!=
nil
&&
channelCache
.
Status
==
status
{
channelStatusLock
.
Unlock
()
channelStatusLock
.
Unlock
()
return
return
}
// 如果缓存渠道不存在(说明已经被禁用),且要设置的状态不为启用,直接返回
if
channelCache
==
nil
&&
status
!=
common
.
ChannelStatusEnabled
{
channelStatusLock
.
Unlock
()
return
}
}
CacheUpdateChannelStatus
(
id
,
status
)
CacheUpdateChannelStatus
(
id
,
status
)
channelStatusLock
.
Unlock
()
channelStatusLock
.
Unlock
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment