diff options
Diffstat (limited to 'app/workers/remove_expired_group_links_worker.rb')
-rw-r--r-- | app/workers/remove_expired_group_links_worker.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/workers/remove_expired_group_links_worker.rb b/app/workers/remove_expired_group_links_worker.rb index 8226f22837c..3f1a484f384 100644 --- a/app/workers/remove_expired_group_links_worker.rb +++ b/app/workers/remove_expired_group_links_worker.rb @@ -7,10 +7,12 @@ class RemoveExpiredGroupLinksWorker # rubocop:disable Scalability/IdempotentWork feature_category :authentication_and_authorization def perform - ProjectGroupLink.expired.destroy_all # rubocop: disable DestroyAll + ProjectGroupLink.expired.find_each do |link| + Projects::GroupLinks::DestroyService.new(link.project, nil).execute(link) + end GroupGroupLink.expired.find_in_batches do |link_batch| - Groups::GroupLinks::DestroyService.new(nil, nil).execute(link_batch) + Groups::GroupLinks::DestroyService.new(nil, nil).execute(link_batch, skip_authorization: true) end end end |