优化http连接池

This commit is contained in:
2025-08-03 14:20:17 +08:00
parent 838430ee2f
commit 84ccaa56de
4 changed files with 45 additions and 13 deletions

View File

@@ -58,8 +58,7 @@ func OssUpload(ctx context.Context, url, filePath string) error {
}
req.Header.Set("Content-Type", "video/mp4")
req.Header.Set("Content-Length", fmt.Sprintf("%d", len(fileBytes)))
client := &http.Client{}
resp, err := client.Do(req)
resp, err := GetUploadClient().Do(req)
if err != nil {
span.SetAttributes(attribute.String("error", err.Error()))
span.SetStatus(codes.Error, "发送请求失败")