Просмотр исходного кода

refactor: remove unused mutex from RelayInfo struct

CaIon 10 месяцев назад
Родитель
Сommit
272662089d
1 измененных файлов с 0 добавлено и 5 удалено
  1. 0 5
      relay/common/relay_info.go

+ 0 - 5
relay/common/relay_info.go

@@ -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