|
|
@@ -6,7 +6,6 @@ import (
|
|
|
"one-api/dto"
|
|
|
relayconstant "one-api/relay/constant"
|
|
|
"strings"
|
|
|
- "sync"
|
|
|
"time"
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
@@ -55,7 +54,6 @@ type RelayInfo struct {
|
|
|
StartTime time.Time
|
|
|
FirstResponseTime time.Time
|
|
|
isFirstResponse bool
|
|
|
- responseMutex sync.Mutex // Add mutex for protecting concurrent access
|
|
|
//SendLastReasoningResponse bool
|
|
|
ApiType int
|
|
|
IsStream bool
|
|
|
@@ -214,9 +212,6 @@ func (info *RelayInfo) SetIsStream(isStream bool) {
|
|
|
}
|
|
|
|
|
|
func (info *RelayInfo) SetFirstResponseTime() {
|
|
|
- info.responseMutex.Lock()
|
|
|
- defer info.responseMutex.Unlock()
|
|
|
-
|
|
|
if info.isFirstResponse {
|
|
|
info.FirstResponseTime = time.Now()
|
|
|
info.isFirstResponse = false
|