2020-07-28 23:09:34 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Ci
|
|
|
|
class RefDeleteUnlockArtifactsWorker
|
|
|
|
include ApplicationWorker
|
|
|
|
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|
|
2020-11-24 15:15:51 +05:30
|
|
|
project.ci_refs.find_by_ref_path(ref_path).try do |ci_ref|
|
2020-07-28 23:09:34 +05:30
|
|
|
::Ci::UnlockArtifactsService
|
|
|
|
.new(project, user)
|
|
|
|
.execute(ci_ref)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|