mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -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: [],
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue