Skip to content

Commit

Permalink
Close record reader after estimation count (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
korotkov-aerospike authored Aug 1, 2024
1 parent 503d6c8 commit cd3f281
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions handler_backup_records.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ func (bh *backupRecordsHandler) countRecords(infoClient *asinfo.InfoClient) (uin
return infoClient.GetRecordCount(bh.config.Namespace, bh.config.SetList)
}

return bh.countRecordsUsingScan()
}

func (bh *backupRecordsHandler) countRecordsUsingScan() (uint64, error) {
scanPolicy := *bh.config.ScanPolicy

scanPolicy.IncludeBinData = false
Expand All @@ -92,6 +96,7 @@ func (bh *backupRecordsHandler) countRecords(infoClient *asinfo.InfoClient) (uin
bh.recordReaderConfigForPartition(PartitionRangeAll(), &scanPolicy),
bh.logger,
)
defer recordReader.Close()

var count uint64

Expand Down

0 comments on commit cd3f281

Please sign in to comment.