diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /app/workers/propagate_integration_inherit_descendant_worker.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'app/workers/propagate_integration_inherit_descendant_worker.rb')
-rw-r--r-- | app/workers/propagate_integration_inherit_descendant_worker.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/workers/propagate_integration_inherit_descendant_worker.rb b/app/workers/propagate_integration_inherit_descendant_worker.rb new file mode 100644 index 00000000000..d589619818c --- /dev/null +++ b/app/workers/propagate_integration_inherit_descendant_worker.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class PropagateIntegrationInheritDescendantWorker + include ApplicationWorker + + feature_category :integrations + idempotent! + + # rubocop: disable CodeReuse/ActiveRecord + def perform(integration_id, min_id, max_id) + integration = Service.find_by_id(integration_id) + return unless integration + + batch = Service.inherited_descendants_from_self_or_ancestors_from(integration).where(id: min_id..max_id) + + BulkUpdateIntegrationService.new(integration, batch).execute + end + # rubocop: enable CodeReuse/ActiveRecord +end |