Skip to content

Commit

Permalink
fix: 修复分块上传文件资源未释放问题 (#5109)
Browse files Browse the repository at this point in the history
  • Loading branch information
qwenode authored and wanghe-fit2cloud committed May 24, 2024
1 parent 73e901b commit 508e2ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/app/api/v1/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 508e2ec

Please sign in to comment.