From b932331bdc0ac5507712539f9dba4bca0a8eb3d5 Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Wed, 8 Nov 2023 20:18:55 +0800 Subject: [PATCH] 20s timeout for large request --- process.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/process.go b/process.go index d1c1ada..5622437 100644 --- a/process.go +++ b/process.go @@ -69,6 +69,9 @@ func processRequest(c *gin.Context, upstream *OPENAI_UPSTREAM, record *Record, s if requestBodyOK == nil && requestBody.Stream { timeout = 5 * time.Second } + if len(inBody) > 1024*128 { + timeout = 20 * time.Second + } // timeout out request go func() {