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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/workers/ci/ref_delete_unlock_artifacts_worker.rb')
-rw-r--r--app/workers/ci/ref_delete_unlock_artifacts_worker.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/workers/ci/ref_delete_unlock_artifacts_worker.rb b/app/workers/ci/ref_delete_unlock_artifacts_worker.rb
new file mode 100644
index 00000000000..3b4a6fcf630
--- /dev/null
+++ b/app/workers/ci/ref_delete_unlock_artifacts_worker.rb
@@ -0,0 +1,22 @@
+# 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|
+ ::Ci::Ref.find_by_ref_path(ref_path).try do |ci_ref|
+ ::Ci::UnlockArtifactsService
+ .new(project, user)
+ .execute(ci_ref)
+ end
+ end
+ end
+ end
+ end
+end