mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-14 20:40:17 -05:00
Merge pull request #4657 from overleaf/jel-check-uni-users
Remove await use since no async GitOrigin-RevId: 43cb8be365bedd95d004ab9e129c75aeab855e53
This commit is contained in:
parent
4737982cdd
commit
f181328db0
1 changed files with 11 additions and 21 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue