Skip to content

Commit

Permalink
fixed close file twice issue when using dfstore upload large file (#2784
Browse files Browse the repository at this point in the history
)

Co-authored-by: Yong.An <[email protected]>
  • Loading branch information
Yong-An9 and Yong.An authored Oct 10, 2023
1 parent 1c36b27 commit e847992
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions client/daemon/objectstorage/objectstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -579,11 +579,7 @@ func (o *objectStorage) importObjectToBackend(ctx context.Context, bucketName, o
if err != nil {
return err
}
defer func() {
if cerr := f.Close(); cerr != nil {
err = errors.Join(err, cerr)
}
}()
defer f.Close()

return o.objectStorageClient.PutObject(ctx, bucketName, objectKey, dgst.String(), f)
}
Expand Down

0 comments on commit e847992

Please sign in to comment.