record response time

This commit is contained in:
2023-11-17 14:53:49 +08:00
parent 31eed99025
commit 4125c78f33
2 changed files with 2 additions and 0 deletions

View File

@@ -133,6 +133,7 @@ func processRequest(c *gin.Context, upstream *OPENAI_UPSTREAM, record *Record, s
}
proxy.ErrorHandler = func(w http.ResponseWriter, r *http.Request, err error) {
haveResponse = true
record.ResponseTime = time.Now().Sub(record.CreatedAt)
log.Println("Error", err, upstream.SK, upstream.Endpoint)
errCtx = err