[WIP] Add initial fixes for concurrency (#9321)

* Add initial fixes for concurrency

* Added memory edit for notifications

* Fixed tag delete

* Fixed adding and moving task order

* Updated delete task

* Fixed lint

* Fixed task adding

* Switch to mongoose push and pull
This commit is contained in:
Keith Holliday
2017-11-07 13:19:39 -07:00
committed by GitHub
parent 0caa195c6f
commit 17ce2febf9
8 changed files with 86 additions and 19 deletions

View File

@@ -37,7 +37,10 @@ api.readNotification = {
}
user.notifications.splice(index, 1);
await user.save();
await user.update({
$pull: { notifications: req.params.notificationId },
}).exec();
res.respond(200, user.notifications);
},
@@ -77,7 +80,9 @@ api.readNotifications = {
user.notifications.splice(index, 1);
}
await user.save();
await user.update({
$pullAll: { notifications },
}).exec();
res.respond(200, user.notifications);
},