Skip to content

Commit

Permalink
Changed timing of messages on mongofw/wr replication.
Browse files Browse the repository at this point in the history
  • Loading branch information
riclolsen committed May 25, 2024
1 parent a66fca9 commit ff27b43
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/mongowr/customized_module.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ async function procQueue() {
//Log.log('Max: ' + maxSz)
//Log.log('CntPrMx: ' + cntPrMx)
Log.log('Queue Size: ' + msgQueue.size())

if (msgQueue.size() > 5000) {
msgQueue.clear()
Log.log('Queue too large! Emptied!')
}
// const dataObj = JSON.parse(msg)
if (!dataObj?.cnt) {
Log.log('Unexpected format')
Expand Down Expand Up @@ -134,10 +137,9 @@ async function procQueue() {
)

await collection.updateOne(
{
...dataObj.documentKey,
},
{ $set: { ...dataObj.updateDescription.updatedFields } }
{ ...dataObj.documentKey },
{ $set: { ...dataObj.updateDescription.updatedFields } },
{ writeConcern: { w: 0 } }
)
} catch (e) {
Log.log('Error: ' + e)
Expand Down

0 comments on commit ff27b43

Please sign in to comment.