refactor: remove unused mutex from RelayInfo struct
This commit is contained in:
@@ -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 {
|
|||||||
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) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user