Commit 62f5f963 authored by Adam Hegyi's avatar Adam Hegyi

Merge branch 'if-remove_recalculate_project_auth_migration' into 'master'

Make RecalculateProjectAuthorizations background migration no-op

See merge request gitlab-org/gitlab!60825
parents d62d5ac4 9679d2f4
---
title: Make RecalculateProjectAuthorizations background migration no-op
merge_request: 60825
author:
type: other
......@@ -5,37 +5,7 @@ module Gitlab
# rubocop:disable Style/Documentation
class RecalculateProjectAuthorizations
def perform(user_ids)
user_ids.each do |user_id|
user = User.find_by(id: user_id)
next unless user
service = Users::RefreshAuthorizedProjectsService.new(
user,
incorrect_auth_found_callback:
->(project_id, access_level) do
logger.info(message: 'Removing ProjectAuthorizations',
user_id: user.id,
project_id: project_id,
access_level: access_level)
end,
missing_auth_found_callback:
->(project_id, access_level) do
logger.info(message: 'Creating ProjectAuthorizations',
user_id: user.id,
project_id: project_id,
access_level: access_level)
end
)
service.execute
end
end
private
def logger
@logger ||= Gitlab::BackgroundMigration::Logger.build
# no-op
end
end
end
......
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