Prevent duplicate challenge tasks (#11502)
* Implement atomic user challenges update Prevents multiple concurrent requests from passing through Fixes #11295 * Move user challenges update to separate method * Rename challenge syncToUser to syncTasksToUser Now that adding the challenge to user is separated, this methods main purpose is to sync the tasks * Fix lint errors
This commit is contained in:
committed by
Matteo Pagliazzi
parent
bdb3cf25c1
commit
cd90a281c2
@@ -10,7 +10,7 @@ async function syncChallengeToMembers (challenges) {
|
||||
|
||||
const promises = [];
|
||||
users.forEach(user => {
|
||||
promises.push(challenge.syncToUser(user));
|
||||
promises.push(challenge.syncTasksToUser(user));
|
||||
promises.push(challenge.save());
|
||||
promises.push(user.save());
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user