fix: in decompress, file stream should be closed after copy it to temp file.

pull/1231/head
HFO4 2022-04-20 11:49:01 +08:00
parent 4f6989f1b8
commit a26183875f
2 changed files with 4 additions and 1 deletions

2
assets

@ -1 +1 @@
Subproject commit 4ca2d3696b227a55b64aa12fb387e80fec62111a Subproject commit 9a46182901733f5a7d0f48895302862afc959c7e

View File

@ -190,6 +190,8 @@ func (fs *FileSystem) Decompress(ctx context.Context, src, dst string) error {
return err return err
} }
defer fileStream.Close()
tempZipFilePath = filepath.Join( tempZipFilePath = filepath.Join(
util.RelativePath(model.GetSettingByName("temp_path")), util.RelativePath(model.GetSettingByName("temp_path")),
"decompress", "decompress",
@ -211,6 +213,7 @@ func (fs *FileSystem) Decompress(ctx context.Context, src, dst string) error {
} }
zipFile.Close() zipFile.Close()
fileStream.Close()
// 解压缩文件 // 解压缩文件
r, err := zip.OpenReader(tempZipFilePath) r, err := zip.OpenReader(tempZipFilePath)