fix: 如果还有数据,等待一会

This commit is contained in:
Xyfacai 2023-11-30 20:28:57 +08:00
parent 6680f6d83a
commit ed22a202f7

View File

@ -78,6 +78,10 @@ func openaiStreamHandler(c *gin.Context, resp *http.Response, relayMode int) (*O
} }
} }
} }
if len(dataChan) > 0 {
// wait data out
time.Sleep(2 * time.Second)
}
stopChan <- true stopChan <- true
}() }()
setEventStreamHeaders(c) setEventStreamHeaders(c)