fix: fix relay openai panic

This commit is contained in:
CaIon
2024-01-10 19:26:11 +08:00
parent 2a3e45c43a
commit c8b3465a29
2 changed files with 17 additions and 1 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ func openaiStreamHandler(c *gin.Context, resp *http.Response, relayMode int) (*O
// wait data out
time.Sleep(2 * time.Second)
}
stopChan <- true
common.SafeSend(stopChan, true)
}()
setEventStreamHeaders(c)
c.Stream(func(w io.Writer) bool {