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
9ab5df93
authored
Oct 14, 2025
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: remove redundant error message details for channel retrieval failures
parent
de1590f5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
controller/relay.go
+1
-1
middleware/distributor.go
+1
-1
No files found.
controller/relay.go
View file @
9ab5df93
...
@@ -229,7 +229,7 @@ func getChannel(c *gin.Context, group, originalModel string, retryCount int) (*m
...
@@ -229,7 +229,7 @@ func getChannel(c *gin.Context, group, originalModel string, retryCount int) (*m
return
nil
,
types
.
NewError
(
fmt
.
Errorf
(
"获取分组 %s 下模型 %s 的可用渠道失败(retry): %s"
,
selectGroup
,
originalModel
,
err
.
Error
()),
types
.
ErrorCodeGetChannelFailed
,
types
.
ErrOptionWithSkipRetry
())
return
nil
,
types
.
NewError
(
fmt
.
Errorf
(
"获取分组 %s 下模型 %s 的可用渠道失败(retry): %s"
,
selectGroup
,
originalModel
,
err
.
Error
()),
types
.
ErrorCodeGetChannelFailed
,
types
.
ErrOptionWithSkipRetry
())
}
}
if
channel
==
nil
{
if
channel
==
nil
{
return
nil
,
types
.
NewError
(
fmt
.
Errorf
(
"分组 %s 下模型 %s 的可用渠道不存在(
数据库一致性已被破坏,
retry)"
,
selectGroup
,
originalModel
),
types
.
ErrorCodeGetChannelFailed
,
types
.
ErrOptionWithSkipRetry
())
return
nil
,
types
.
NewError
(
fmt
.
Errorf
(
"分组 %s 下模型 %s 的可用渠道不存在(retry)"
,
selectGroup
,
originalModel
),
types
.
ErrorCodeGetChannelFailed
,
types
.
ErrOptionWithSkipRetry
())
}
}
newAPIError
:=
middleware
.
SetupContextForSelectedChannel
(
c
,
channel
,
originalModel
)
newAPIError
:=
middleware
.
SetupContextForSelectedChannel
(
c
,
channel
,
originalModel
)
if
newAPIError
!=
nil
{
if
newAPIError
!=
nil
{
...
...
middleware/distributor.go
View file @
9ab5df93
...
@@ -102,7 +102,7 @@ func Distribute() func(c *gin.Context) {
...
@@ -102,7 +102,7 @@ func Distribute() func(c *gin.Context) {
if
userGroup
==
"auto"
{
if
userGroup
==
"auto"
{
showGroup
=
fmt
.
Sprintf
(
"auto(%s)"
,
selectGroup
)
showGroup
=
fmt
.
Sprintf
(
"auto(%s)"
,
selectGroup
)
}
}
message
:=
fmt
.
Sprintf
(
"获取分组 %s 下模型 %s 的可用渠道失败(
数据库一致性已被破坏,
distributor): %s"
,
showGroup
,
modelRequest
.
Model
,
err
.
Error
())
message
:=
fmt
.
Sprintf
(
"获取分组 %s 下模型 %s 的可用渠道失败(distributor): %s"
,
showGroup
,
modelRequest
.
Model
,
err
.
Error
())
// 如果错误,但是渠道不为空,说明是数据库一致性问题
// 如果错误,但是渠道不为空,说明是数据库一致性问题
//if channel != nil {
//if channel != nil {
// common.SysError(fmt.Sprintf("渠道不存在:%d", channel.Id))
// common.SysError(fmt.Sprintf("渠道不存在:%d", channel.Id))
...
...
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