Commit 50bf4a66 by CaIon

refactor: remove unused mutex from RelayInfo struct

parent 115c8539
...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment