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

fix: playground request_start_time

CalciumIon 1 год назад
Родитель
Сommit
65d1cde8fb
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      controller/playground.go

+ 3 - 0
controller/playground.go

@@ -6,11 +6,13 @@ import (
 	"github.com/gin-gonic/gin"
 	"github.com/gin-gonic/gin"
 	"net/http"
 	"net/http"
 	"one-api/common"
 	"one-api/common"
+	"one-api/constant"
 	"one-api/dto"
 	"one-api/dto"
 	"one-api/middleware"
 	"one-api/middleware"
 	"one-api/model"
 	"one-api/model"
 	"one-api/service"
 	"one-api/service"
 	"one-api/setting"
 	"one-api/setting"
+	"time"
 )
 )
 
 
 func Playground(c *gin.Context) {
 func Playground(c *gin.Context) {
@@ -62,5 +64,6 @@ func Playground(c *gin.Context) {
 		return
 		return
 	}
 	}
 	middleware.SetupContextForSelectedChannel(c, channel, playgroundRequest.Model)
 	middleware.SetupContextForSelectedChannel(c, channel, playgroundRequest.Model)
+	c.Set(constant.ContextKeyRequestStartTime, time.Now())
 	Relay(c)
 	Relay(c)
 }
 }