fix: fix relay openai panic

This commit is contained in:
CaIon
2024-01-10 19:26:11 +08:00
parent d04d2a6c4d
commit 701a28d0da
2 changed files with 17 additions and 1 deletions

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 {