mirror of
https://github.com/AlistGo/alist.git
synced 2025-04-22 21:04:07 +08:00
fix: ignore os.ErrClosed error on repeated FileStream close operations (#6762)
Also resolves the issue where S3 PutObject returns a 500 status code.
This commit is contained in:
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…
x
Reference in New Issue
Block a user