mirror of https://github.com/Xhofe/alist
fix: ignore os.ErrClosed error on repeated FileStream close operations (#6762)
Also resolves the issue where S3 PutObject returns a 500 status code.pull/6783/head
parent
736ba44031
commit
8278d3875b
|
@ -51,7 +51,11 @@ func (f *FileStream) IsForceStreamUpload() bool {
|
|||
|
||||
func (f *FileStream) Close() error {
|
||||
var err1, err2 error
|
||||
|
||||
err1 = f.Closers.Close()
|
||||
if errors.Is(err1, os.ErrClosed) {
|
||||
err1 = nil
|
||||
}
|
||||
if f.tmpFile != nil {
|
||||
err2 = os.RemoveAll(f.tmpFile.Name())
|
||||
if err2 != nil {
|
||||
|
|
Loading…
Reference in New Issue