diff options
author | Nick Thomas <nick@gitlab.com> | 2017-08-23 15:28:16 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2017-08-25 16:19:32 +0100 |
commit | 8b73df0cf534797bff9ce0f5b95af5347ea59ca6 (patch) | |
tree | 9dea336cc8619391dbdf6c904a3f72e873c37090 /app/models | |
parent | 24244d03b55bc7732b3362bab1e1cc7e04c2dabf (diff) | |
download | gitlab-ce-8b73df0cf534797bff9ce0f5b95af5347ea59ca6.tar.gz |
Move sidekiq-based project authorization refresh out of Projects::CreateService
If the project is in a group, the `group.refresh_members_authorized_projects`
is made non-blocking, and we call `current_user.refresh_authorized_projects`
directly.
Projects in a personal namespace are more difficult. Rather than passing the
`blocking:` parameter through the entire `add_master` chain, have the
`AuthorizedProjectsWorker` automatically inline authorizations for three IDs or
less. Since the maximum number of IDs in this path is 2, that has the same effect.
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/group.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/group.rb b/app/models/group.rb index 2816a68257c..cb3ee032f69 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -206,9 +206,9 @@ class Group < Namespace SystemHooksService.new end - def refresh_members_authorized_projects + def refresh_members_authorized_projects(blocking: true) UserProjectAccessChangedService.new(user_ids_for_project_authorizations) - .execute + .execute(blocking: blocking) end def user_ids_for_project_authorizations |