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
Unverified
Commit
b4df9955
authored
Apr 12, 2026
by
skynono
Committed by
GitHub
Apr 12, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: isStream status in error logs instead of hardcoded false (#4195)
parent
59c582d1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
1 deletions
+3
-1
constant/context_key.go
+1
-0
controller/relay.go
+1
-1
relay/common/relay_info.go
+1
-0
No files found.
constant/context_key.go
View file @
b4df9955
...
@@ -65,4 +65,5 @@ const (
...
@@ -65,4 +65,5 @@ const (
// ContextKeyLanguage stores the user's language preference for i18n
// ContextKeyLanguage stores the user's language preference for i18n
ContextKeyLanguage
ContextKey
=
"language"
ContextKeyLanguage
ContextKey
=
"language"
ContextKeyIsStream
ContextKey
=
"is_stream"
)
)
controller/relay.go
View file @
b4df9955
...
@@ -389,7 +389,7 @@ func processChannelError(c *gin.Context, channelError types.ChannelError, err *t
...
@@ -389,7 +389,7 @@ func processChannelError(c *gin.Context, channelError types.ChannelError, err *t
startTime
=
time
.
Now
()
startTime
=
time
.
Now
()
}
}
useTimeSeconds
:=
int
(
time
.
Since
(
startTime
)
.
Seconds
())
useTimeSeconds
:=
int
(
time
.
Since
(
startTime
)
.
Seconds
())
model
.
RecordErrorLog
(
c
,
userId
,
channelId
,
modelName
,
tokenName
,
err
.
MaskSensitiveErrorWithStatusCode
(),
tokenId
,
useTimeSeconds
,
false
,
userGroup
,
other
)
model
.
RecordErrorLog
(
c
,
userId
,
channelId
,
modelName
,
tokenName
,
err
.
MaskSensitiveErrorWithStatusCode
(),
tokenId
,
useTimeSeconds
,
common
.
GetContextKeyBool
(
c
,
constant
.
ContextKeyIsStream
)
,
userGroup
,
other
)
}
}
}
}
...
...
relay/common/relay_info.go
View file @
b4df9955
...
@@ -438,6 +438,7 @@ func genBaseRelayInfo(c *gin.Context, request dto.Request) *RelayInfo {
...
@@ -438,6 +438,7 @@ func genBaseRelayInfo(c *gin.Context, request dto.Request) *RelayInfo {
if
request
!=
nil
{
if
request
!=
nil
{
isStream
=
request
.
IsStream
(
c
)
isStream
=
request
.
IsStream
(
c
)
}
}
c
.
Set
(
string
(
constant
.
ContextKeyIsStream
),
isStream
)
// firstResponseTime = time.Now() - 1 second
// firstResponseTime = time.Now() - 1 second
...
...
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