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
f53154a9
authored
Jun 27, 2024
by
Calcium-Ion
Committed by
GitHub
Jun 27, 2024
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #335 from HynoR/fix/v1
fix testAllChannels nil pointer panic
parents
4b45e550
38e2b3da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
controller/channel-test.go
+12
-10
No files found.
controller/channel-test.go
View file @
f53154a9
...
@@ -222,16 +222,18 @@ func testAllChannels(notify bool) error {
...
@@ -222,16 +222,18 @@ func testAllChannels(notify bool) error {
if
channel
.
AutoBan
!=
nil
&&
*
channel
.
AutoBan
==
0
{
if
channel
.
AutoBan
!=
nil
&&
*
channel
.
AutoBan
==
0
{
ban
=
false
ban
=
false
}
}
openAiErrWithStatus
:=
dto
.
OpenAIErrorWithStatusCode
{
if
openaiErr
!=
nil
{
StatusCode
:
-
1
,
openAiErrWithStatus
:=
dto
.
OpenAIErrorWithStatusCode
{
Error
:
*
openaiErr
,
StatusCode
:
-
1
,
LocalError
:
false
,
Error
:
*
openaiErr
,
}
LocalError
:
false
,
if
isChannelEnabled
&&
service
.
ShouldDisableChannel
(
&
openAiErrWithStatus
)
&&
ban
{
}
service
.
DisableChannel
(
channel
.
Id
,
channel
.
Name
,
err
.
Error
())
if
isChannelEnabled
&&
service
.
ShouldDisableChannel
(
&
openAiErrWithStatus
)
&&
ban
{
}
service
.
DisableChannel
(
channel
.
Id
,
channel
.
Name
,
err
.
Error
())
if
!
isChannelEnabled
&&
service
.
ShouldEnableChannel
(
err
,
openaiErr
,
channel
.
Status
)
{
}
service
.
EnableChannel
(
channel
.
Id
,
channel
.
Name
)
if
!
isChannelEnabled
&&
service
.
ShouldEnableChannel
(
err
,
openaiErr
,
channel
.
Status
)
{
service
.
EnableChannel
(
channel
.
Id
,
channel
.
Name
)
}
}
}
channel
.
UpdateResponseTime
(
milliseconds
)
channel
.
UpdateResponseTime
(
milliseconds
)
time
.
Sleep
(
common
.
RequestInterval
)
time
.
Sleep
(
common
.
RequestInterval
)
...
...
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