fix(123,189pc,alidriver,xunlei):tempfile remove

This commit is contained in:
foxxorcat
2022-05-16 09:48:33 +08:00
parent 39b8f28fc4
commit f2b2728be7
4 changed files with 24 additions and 13 deletions

View File

@ -363,8 +363,10 @@ func (driver XunLeiCloud) Upload(file *model.FileStream, account *model.Account)
return err
}
defer tempFile.Close()
defer os.Remove(tempFile.Name())
defer func() {
_ = tempFile.Close()
_ = os.Remove(tempFile.Name())
}()
gcid, err := getGcid(io.TeeReader(file, tempFile), int64(file.Size))
if err != nil {