Browse Source

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

zipped-static
HFO4 3 years ago
parent
commit
a26183875f
  1. 2
      assets
  2. 3
      pkg/filesystem/archive.go

2
assets

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

3
pkg/filesystem/archive.go

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

Loading…
Cancel
Save