Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ref_delete_unlock_artifacts_worker.rb « ci « workers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d20c501100e068f09b33d5a20ac81c1c6d36e789 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

module Ci
  class RefDeleteUnlockArtifactsWorker
    include ApplicationWorker

    sidekiq_options retry: 3
    include PipelineBackgroundQueue

    idempotent!

    def perform(project_id, user_id, ref_path)
      ::Project.find_by_id(project_id).try do |project|
        ::User.find_by_id(user_id).try do |user|
          project.ci_refs.find_by_ref_path(ref_path).try do |ci_ref|
            ::Ci::UnlockArtifactsService
              .new(project, user)
              .execute(ci_ref)
          end
        end
      end
    end
  end
end