mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #5819 from overleaf/jpa-chat-race
[chat] fix race condition of concurrent delete operations GitOrigin-RevId: 149c5121791af54cd6c27c3458d81641fb522b3d
This commit is contained in:
parent
fc086fba29
commit
05cb9c49bf
1 changed files with 4 additions and 4 deletions
|
@ -47,15 +47,15 @@ module.exports = ThreadManager = {
|
|||
}
|
||||
}
|
||||
|
||||
db.rooms.updateOne(
|
||||
db.rooms.findOneAndUpdate(
|
||||
query,
|
||||
{ $set: update },
|
||||
{ upsert: true },
|
||||
function (error) {
|
||||
{ upsert: true, returnDocument: 'after' },
|
||||
function (error, result) {
|
||||
if (error != null) {
|
||||
return callback(error)
|
||||
}
|
||||
db.rooms.findOne(query, callback)
|
||||
callback(null, result.value)
|
||||
}
|
||||
)
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue