Remove parallel calls to save (#10416)

* remove parallel saves from the code

* fix more unit tests

* do not save users when sending message in buyGift (saved later)

* fix test

* reinstall

* fix tests

* fix tests
This commit is contained in:
Matteo Pagliazzi
2018-06-01 15:56:01 +02:00
committed by GitHub
parent 1e786412ba
commit a35c1954af
8 changed files with 108 additions and 111 deletions

View File

@@ -312,7 +312,7 @@ api.leaveChallenge = {
if (!challenge.isMember(user)) throw new NotAuthorized(res.t('challengeMemberNotFound'));
// Unlink challenge's tasks from user's tasks and save the challenge
await Promise.all([challenge.unlinkTasks(user, keep), challenge.save()]);
await challenge.unlinkTasks(user, keep);
res.analytics.track('challenge leave', {
uuid: user._id,