ilm: Close warmBackend GetObject reader (#12174)

This commit is contained in:
Krishnan Parthasarathi 2021-04-27 22:42:18 -07:00 committed by GitHub
parent b0baaeaa3d
commit 0c9d095deb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -341,7 +341,10 @@ func getTransitionedObjectReader(ctx context.Context, bucket, object string, rs
if err != nil {
return nil, err
}
return fn(reader, h, opts.CheckPrecondFn)
closer := func() {
reader.Close()
}
return fn(reader, h, opts.CheckPrecondFn, closer)
}
// RestoreRequestType represents type of restore.