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 {
|
func (f *FileStream) Close() error {
|
||||||
var err1, err2 error
|
var err1, err2 error
|
||||||
|
|
||||||
err1 = f.Closers.Close()
|
err1 = f.Closers.Close()
|
||||||
|
if errors.Is(err1, os.ErrClosed) {
|
||||||
|
err1 = nil
|
||||||
|
}
|
||||||
if f.tmpFile != nil {
|
if f.tmpFile != nil {
|
||||||
err2 = os.RemoveAll(f.tmpFile.Name())
|
err2 = os.RemoveAll(f.tmpFile.Name())
|
||||||
if err2 != nil {
|
if err2 != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user