Merge pull request #4657 from overleaf/jel-check-uni-users

Remove await use since no async

GitOrigin-RevId: 43cb8be365bedd95d004ab9e129c75aeab855e53
This commit is contained in:
June Kelly 2021-08-11 09:50:14 +01:00 committed by Copybot
parent 4737982cdd
commit f181328db0

View file

@ -55,29 +55,19 @@ async function _checkUsersFeatures(userIds) {
nonProUserIds: [], nonProUserIds: [],
} }
await new Promise((resolve, reject) => { users.forEach(user => {
async.eachLimit( const hasProFeaturesOrBetter = FeaturesUpdater.isFeatureSetBetter(
users, user.features,
ASYNC_LIMIT, Settings.features.professional
(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()
}
) )
if (hasProFeaturesOrBetter) {
result.proUserIds.push(user._id)
} else {
result.nonProUserIds.push(user._id)
}
}) })
return result return result
} }