diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-17 21:10:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-17 21:10:42 +0300 |
commit | 49bb78aac34a111c0fb13aae3a83b078be351fd3 (patch) | |
tree | 510df08e78b39ef88631f8f25bdc371a4661caa9 /app/workers/ci | |
parent | 68c476dbd8a2c670aeeebffce8b63b554a3ac7f0 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers/ci')
-rw-r--r-- | app/workers/ci/retry_pipeline_worker.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/workers/ci/retry_pipeline_worker.rb b/app/workers/ci/retry_pipeline_worker.rb new file mode 100644 index 00000000000..7a1906b3ef9 --- /dev/null +++ b/app/workers/ci/retry_pipeline_worker.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Ci + class RetryPipelineWorker # rubocop:disable Scalability/IdempotentWorker + include ::ApplicationWorker + include ::PipelineQueue + + urgency :high + worker_resource_boundary :cpu + + def perform(pipeline_id, user_id) + ::Ci::Pipeline.find_by_id(pipeline_id).try do |pipeline| + ::User.find_by_id(user_id).try do |user| + pipeline.retry_failed(user) + end + end + end + end +end |