mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #1190 from sharelatex/ta-team-importer-timeout-fix
Team Importer Timeout Fix GitOrigin-RevId: 4951262e3eb980b45e3ba5785c1d17c58aa5009e
This commit is contained in:
parent
05801085b0
commit
be6950292d
1 changed files with 9 additions and 7 deletions
|
@ -29,13 +29,7 @@ module.exports = SubscriptionUpdater =
|
|||
@addUsersToGroup(subscriptionId, [userId], callback)
|
||||
|
||||
addUsersToGroup: (subscriptionId, memberIds, callback)->
|
||||
logger.log subscriptionId: subscriptionId, memberIds: memberIds, "adding members into mongo subscription"
|
||||
searchOps =
|
||||
_id: subscriptionId
|
||||
insertOperation =
|
||||
{ $addToSet: { member_ids: { $each: memberIds } } }
|
||||
|
||||
Subscription.findAndModify searchOps, insertOperation, (err, subscription) ->
|
||||
@addUsersToGroupWithoutFeaturesRefresh subscriptionId, memberIds, (err) ->
|
||||
return callback(err) if err?
|
||||
|
||||
# Only apply features updates to users, not user stubs
|
||||
|
@ -45,6 +39,14 @@ module.exports = SubscriptionUpdater =
|
|||
userIds = users.map (u) -> u._id.toString()
|
||||
async.map userIds, FeaturesUpdater.refreshFeatures, callback
|
||||
|
||||
addUsersToGroupWithoutFeaturesRefresh: (subscriptionId, memberIds, callback)->
|
||||
logger.log subscriptionId: subscriptionId, memberIds: memberIds, "adding members into mongo subscription"
|
||||
searchOps =
|
||||
_id: subscriptionId
|
||||
insertOperation =
|
||||
{ $addToSet: { member_ids: { $each: memberIds } } }
|
||||
|
||||
Subscription.findAndModify searchOps, insertOperation, callback
|
||||
|
||||
removeUserFromGroup: (subscriptionId, user_id, callback)->
|
||||
searchOps =
|
||||
|
|
Loading…
Reference in a new issue