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
50bf4a66
authored
Apr 15, 2025
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: remove unused mutex from RelayInfo struct
parent
115c8539
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
5 deletions
+0
-5
relay/common/relay_info.go
+0
-5
No files found.
relay/common/relay_info.go
View file @
50bf4a66
...
@@ -6,7 +6,6 @@ import (
...
@@ -6,7 +6,6 @@ import (
"one-api/dto"
"one-api/dto"
relayconstant
"one-api/relay/constant"
relayconstant
"one-api/relay/constant"
"strings"
"strings"
"sync"
"time"
"time"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin"
...
@@ -55,7 +54,6 @@ type RelayInfo struct {
...
@@ -55,7 +54,6 @@ type RelayInfo struct {
StartTime
time
.
Time
StartTime
time
.
Time
FirstResponseTime
time
.
Time
FirstResponseTime
time
.
Time
isFirstResponse
bool
isFirstResponse
bool
responseMutex
sync
.
Mutex
// Add mutex for protecting concurrent access
//SendLastReasoningResponse bool
//SendLastReasoningResponse bool
ApiType
int
ApiType
int
IsStream
bool
IsStream
bool
...
@@ -214,9 +212,6 @@ func (info *RelayInfo) SetIsStream(isStream bool) {
...
@@ -214,9 +212,6 @@ func (info *RelayInfo) SetIsStream(isStream bool) {
}
}
func
(
info
*
RelayInfo
)
SetFirstResponseTime
()
{
func
(
info
*
RelayInfo
)
SetFirstResponseTime
()
{
info
.
responseMutex
.
Lock
()
defer
info
.
responseMutex
.
Unlock
()
if
info
.
isFirstResponse
{
if
info
.
isFirstResponse
{
info
.
FirstResponseTime
=
time
.
Now
()
info
.
FirstResponseTime
=
time
.
Now
()
info
.
isFirstResponse
=
false
info
.
isFirstResponse
=
false
...
...
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