mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #3872 from overleaf/jpa-batched-update-work-around-mongo-bug
[scripts] work around broken .setReadPreference() on mongo cursor GitOrigin-RevId: 127c0593f4c20e45acb15ec26b45a45d9449d9ba
This commit is contained in:
parent
ae212feec4
commit
9c38d41652
1 changed files with 1 additions and 2 deletions
|
@ -13,11 +13,10 @@ async function getNextBatch(collection, query, maxId, projection) {
|
|||
query._id = { $gt: maxId }
|
||||
}
|
||||
const entries = await collection
|
||||
.find(query)
|
||||
.find(query, { readPreference: ReadPreference.SECONDARY })
|
||||
.project(projection)
|
||||
.sort({ _id: 1 })
|
||||
.limit(BATCH_SIZE)
|
||||
.setReadPreference(ReadPreference.SECONDARY)
|
||||
.toArray()
|
||||
return entries
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue