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

@ -467,8 +467,10 @@ func (driver AliDrive) Upload(file *model.FileStream, account *model.Account) er
return err
}
defer tempFile.Close()
defer os.Remove(tempFile.Name())
defer func() {
_ = tempFile.Close()
_ = os.Remove(tempFile.Name())
}()
delete(reqBody, "pre_hash")
h := sha1.New()