diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-22 18:09:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-22 18:09:27 +0300 |
commit | e829ca213b25b49faa619c0363059c6ed0a5a112 (patch) | |
tree | 0db00d8f17cf6f278cc68fb6b3739fda8d44fea6 /app/workers | |
parent | 6046a605fdbb6d180861c978d17fe3516b2e7507 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers')
3 files changed, 57 insertions, 1 deletions
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index 3a25ce2e870..8750223e2bf 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -5,7 +5,7 @@ --- - :name: authorized_project_update:authorized_project_update_project_create :feature_category: :authentication_and_authorization - :has_external_dependencies: + :has_external_dependencies: :urgency: :low :resource_boundary: :unknown :weight: 1 @@ -13,6 +13,14 @@ :tags: [] - :name: authorized_project_update:authorized_project_update_project_group_link_create :feature_category: :authentication_and_authorization + :has_external_dependencies: + :urgency: :low + :resource_boundary: :unknown + :weight: 1 + :idempotent: true + :tags: [] +- :name: authorized_project_update:authorized_project_update_user_refresh_over_user_range + :feature_category: :authentication_and_authorization :has_external_dependencies: :urgency: :low :resource_boundary: :unknown @@ -107,6 +115,14 @@ :weight: 1 :idempotent: :tags: [] +- :name: cronjob:authorized_project_update_periodic_recalculate + :feature_category: :source_code_management + :has_external_dependencies: + :urgency: :low + :resource_boundary: :unknown + :weight: 1 + :idempotent: true + :tags: [] - :name: cronjob:ci_archive_traces_cron :feature_category: :continuous_integration :has_external_dependencies: diff --git a/app/workers/authorized_project_update/periodic_recalculate_worker.rb b/app/workers/authorized_project_update/periodic_recalculate_worker.rb new file mode 100644 index 00000000000..0d1ad67d7bb --- /dev/null +++ b/app/workers/authorized_project_update/periodic_recalculate_worker.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module AuthorizedProjectUpdate + class PeriodicRecalculateWorker + include ApplicationWorker + # This worker does not perform work scoped to a context + include CronjobQueue # rubocop:disable Scalability/CronWorkerContext + + feature_category :source_code_management + urgency :low + + idempotent! + + def perform + if ::Feature.enabled?(:periodic_project_authorization_recalculation, default_enabled: true) + AuthorizedProjectUpdate::PeriodicRecalculateService.new.execute + end + end + end +end 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 new file mode 100644 index 00000000000..336b1c5443e --- /dev/null +++ b/app/workers/authorized_project_update/user_refresh_over_user_range_worker.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module AuthorizedProjectUpdate + class UserRefreshOverUserRangeWorker + include ApplicationWorker + + feature_category :authentication_and_authorization + urgency :low + queue_namespace :authorized_project_update + deduplicate :until_executing, including_scheduled: true + + idempotent! + + def perform(start_user_id, end_user_id) + if ::Feature.enabled?(:periodic_project_authorization_recalculation, default_enabled: true) + AuthorizedProjectUpdate::RecalculateForUserRangeService.new(start_user_id, end_user_id).execute + end + end + end +end |