Commit d347c606 authored by Imre Farkas's avatar Imre Farkas

Merge branch 'mmj-use-project-recalculate-worker-for-project-group-link-create' into 'master'

Use ProjectRecalculateWorker to refresh authorizations for Project-Group link create endpoints

See merge request gitlab-org/gitlab!65707
parents 715fc55a 3a3fb059
......@@ -13,7 +13,7 @@ module Projects
)
if link.save
setup_authorizations(group, link.group_access)
setup_authorizations(group)
success(link: link)
else
error(link.errors.full_messages.to_sentence, 409)
......@@ -22,9 +22,8 @@ module Projects
private
def setup_authorizations(group, group_access = nil)
AuthorizedProjectUpdate::ProjectGroupLinkCreateWorker.perform_async(
project.id, group.id, group_access)
def setup_authorizations(group)
AuthorizedProjectUpdate::ProjectRecalculateWorker.perform_async(project.id)
# AuthorizedProjectsWorker uses an exclusive lease per user but
# specialized workers might have synchronization issues. Until we
......
......@@ -50,9 +50,9 @@ RSpec.describe Projects::GroupLinks::CreateService, '#execute' do
expect(AuthorizedProjectsWorker).not_to(
receive(:bulk_perform_async)
)
expect(AuthorizedProjectUpdate::ProjectGroupLinkCreateWorker).to(
expect(AuthorizedProjectUpdate::ProjectRecalculateWorker).to(
receive(:perform_async)
.with(project.id, group.id, group_access)
.with(project.id)
.and_call_original
)
expect(AuthorizedProjectUpdate::UserRefreshFromReplicaWorker).to(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment