diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /app/workers/authorized_project_update | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'app/workers/authorized_project_update')
4 files changed, 16 insertions, 1 deletions
diff --git a/app/workers/authorized_project_update/periodic_recalculate_worker.rb b/app/workers/authorized_project_update/periodic_recalculate_worker.rb index 78ffdbca4d6..2f6a9c42c0c 100644 --- a/app/workers/authorized_project_update/periodic_recalculate_worker.rb +++ b/app/workers/authorized_project_update/periodic_recalculate_worker.rb @@ -3,6 +3,8 @@ module AuthorizedProjectUpdate class PeriodicRecalculateWorker include ApplicationWorker + + sidekiq_options retry: 3 # This worker does not perform work scoped to a context include CronjobQueue # rubocop:disable Scalability/CronWorkerContext diff --git a/app/workers/authorized_project_update/project_create_worker.rb b/app/workers/authorized_project_update/project_create_worker.rb index 651849b57ec..52b740b4efe 100644 --- a/app/workers/authorized_project_update/project_create_worker.rb +++ b/app/workers/authorized_project_update/project_create_worker.rb @@ -4,6 +4,8 @@ module AuthorizedProjectUpdate class ProjectCreateWorker include ApplicationWorker + sidekiq_options retry: 3 + feature_category :authentication_and_authorization urgency :low queue_namespace :authorized_project_update diff --git a/app/workers/authorized_project_update/project_group_link_create_worker.rb b/app/workers/authorized_project_update/project_group_link_create_worker.rb index dd24a9602bb..d887a2ce25f 100644 --- a/app/workers/authorized_project_update/project_group_link_create_worker.rb +++ b/app/workers/authorized_project_update/project_group_link_create_worker.rb @@ -4,6 +4,8 @@ module AuthorizedProjectUpdate class ProjectGroupLinkCreateWorker include ApplicationWorker + sidekiq_options retry: 3 + feature_category :authentication_and_authorization urgency :low queue_namespace :authorized_project_update diff --git a/app/workers/authorized_project_update/user_refresh_over_user_range_worker.rb b/app/workers/authorized_project_update/user_refresh_over_user_range_worker.rb index 6635c322ab8..2e4e2dd3232 100644 --- a/app/workers/authorized_project_update/user_refresh_over_user_range_worker.rb +++ b/app/workers/authorized_project_update/user_refresh_over_user_range_worker.rb @@ -15,6 +15,8 @@ module AuthorizedProjectUpdate include ApplicationWorker + sidekiq_options retry: 3 + feature_category :authentication_and_authorization urgency :low queue_namespace :authorized_project_update @@ -22,7 +24,7 @@ module AuthorizedProjectUpdate # `data_consistency :delayed` and not `idempotent!` # See https://gitlab.com/gitlab-org/gitlab/-/issues/325291 deduplicate :until_executing, including_scheduled: true - data_consistency :delayed, feature_flag: :periodic_project_authorization_update_via_replica + data_consistency :delayed, feature_flag: :delayed_consistency_for_user_refresh_over_range_worker def perform(start_user_id, end_user_id) if Feature.enabled?(:periodic_project_authorization_update_via_replica) @@ -30,12 +32,17 @@ module AuthorizedProjectUpdate enqueue_project_authorizations_refresh(user) if project_authorizations_needs_refresh?(user) end else + use_primary_database AuthorizedProjectUpdate::RecalculateForUserRangeService.new(start_user_id, end_user_id).execute end end private + def use_primary_database + # no-op in CE, overriden in EE + end + def project_authorizations_needs_refresh?(user) AuthorizedProjectUpdate::FindRecordsDueForRefreshService.new(user).needs_refresh? end @@ -47,3 +54,5 @@ module AuthorizedProjectUpdate end end end + +AuthorizedProjectUpdate::UserRefreshOverUserRangeWorker.prepend_mod_with('AuthorizedProjectUpdate::UserRefreshOverUserRangeWorker') |