diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /app/services/projects/group_links/destroy_service.rb | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'app/services/projects/group_links/destroy_service.rb')
-rw-r--r-- | app/services/projects/group_links/destroy_service.rb | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/app/services/projects/group_links/destroy_service.rb b/app/services/projects/group_links/destroy_service.rb index bfe704cd780..01a5b617b46 100644 --- a/app/services/projects/group_links/destroy_service.rb +++ b/app/services/projects/group_links/destroy_service.rb @@ -13,9 +13,27 @@ module Projects end group_link.destroy.tap do |link| - link.group.refresh_members_authorized_projects + if Feature.enabled?(:use_specialized_worker_for_project_auth_recalculation) + refresh_project_authorizations_asynchronously(link.project) + + # Until we compare the inconsistency rates of the new specialized worker and + # the old approach, we still run AuthorizedProjectsWorker + # but with some delay and lower urgency as a safety net. + link.group.refresh_members_authorized_projects( + blocking: false, + priority: UserProjectAccessChangedService::LOW_PRIORITY + ) + else + link.group.refresh_members_authorized_projects + end end end + + private + + def refresh_project_authorizations_asynchronously(project) + AuthorizedProjectUpdate::ProjectRecalculateWorker.perform_async(project.id) + end end end end |