fix: 修复分块上传文件资源未释放问题 (#5109)
Some checks failed
Build / SonarCloud (push) Failing after -4m31s
Build Test / build-linux-binary (push) Failing after 8s
sync2gitee / repo-sync (push) Failing after -4m34s

This commit is contained in:
Node 2024-05-23 16:41:19 +08:00 committed by GitHub
parent f211b6b5ae
commit 3df8863904
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -609,7 +609,7 @@ func mergeChunks(fileName string, fileDir string, dstDir string, chunkCount int)
if err != nil {
return err
}
defer targetFile.Close()
for i := 0; i < chunkCount; i++ {
chunkPath := filepath.Join(fileDir, fmt.Sprintf("%s.%d", fileName, i))
chunkData, err := os.ReadFile(chunkPath)