From f181328db05c7c0ab556bcd92516d8ec690cdcd4 Mon Sep 17 00:00:00 2001 From: June Kelly Date: Wed, 11 Aug 2021 09:50:14 +0100 Subject: [PATCH] Merge pull request #4657 from overleaf/jel-check-uni-users Remove await use since no async GitOrigin-RevId: 43cb8be365bedd95d004ab9e129c75aeab855e53 --- .../Institutions/InstitutionsManager.js | 32 +++++++------------ 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/services/web/app/src/Features/Institutions/InstitutionsManager.js b/services/web/app/src/Features/Institutions/InstitutionsManager.js index 4318394a74..994c8538b2 100644 --- a/services/web/app/src/Features/Institutions/InstitutionsManager.js +++ b/services/web/app/src/Features/Institutions/InstitutionsManager.js @@ -55,29 +55,19 @@ async function _checkUsersFeatures(userIds) { nonProUserIds: [], } - await new Promise((resolve, reject) => { - async.eachLimit( - users, - ASYNC_LIMIT, - (user, callback) => { - const hasProFeaturesOrBetter = FeaturesUpdater.isFeatureSetBetter( - user.features, - Settings.features.professional - ) - - if (hasProFeaturesOrBetter) { - result.proUserIds.push(user._id) - } else { - result.nonProUserIds.push(user._id) - } - callback() - }, - error => { - if (error) return reject(error) - resolve() - } + users.forEach(user => { + const hasProFeaturesOrBetter = FeaturesUpdater.isFeatureSetBetter( + user.features, + Settings.features.professional ) + + if (hasProFeaturesOrBetter) { + result.proUserIds.push(user._id) + } else { + result.nonProUserIds.push(user._id) + } }) + return result }