Skip to content

Commit 672b354

Browse files
committed
Close reader for selective restore of config db
1 parent 9f90639 commit 672b354

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pbm/restore/selective.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ func (r *Restore) configsvrRestoreDatabases(
127127
if err != nil {
128128
return err
129129
}
130+
defer rdr.Close()
131+
130132
rdr, err = compress.Decompress(rdr, bcp.Compression)
131133
if err != nil {
132134
return err
@@ -210,6 +212,8 @@ func (r *Restore) configsvrRestoreCollections(
210212
if err != nil {
211213
return nil, err
212214
}
215+
defer rdr.Close()
216+
213217
rdr, err = compress.Decompress(rdr, bcp.Compression)
214218
if err != nil {
215219
return nil, err
@@ -274,6 +278,8 @@ func (r *Restore) configsvrRestoreChunks(
274278
if err != nil {
275279
return err
276280
}
281+
defer rdr.Close()
282+
277283
rdr, err = compress.Decompress(rdr, bcp.Compression)
278284
if err != nil {
279285
return err

0 commit comments

Comments
 (0)