Skip to content

Commit

Permalink
batch size as 1000
Browse files Browse the repository at this point in the history
  • Loading branch information
jh-bate committed Dec 21, 2023
1 parent 3f9d74f commit 84e90b3
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -381,15 +381,17 @@ func (m *Migration) fetchAndUpdateBatch() bool {

m.updates = []mongo.WriteModel{}

size := int32(1000)

if dataC := m.getDataCollection(); dataC != nil {
fetchStart := time.Now()
dDataCursor, err := dataC.Find(m.ctx, selector,
&options.FindOptions{
Limit: &m.config.readBatchSize,
Sort: bson.M{"_id": 1},
Limit: &m.config.readBatchSize,
Sort: bson.M{"_id": 1},
BatchSize: &size,
},
)
dDataCursor.SetBatchSize(1000)

if err != nil {
log.Printf("failed to select data: %s", err)
Expand Down

0 comments on commit 84e90b3

Please sign in to comment.