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/namespaceless_project_destroy_worker.rb')
-rw-r--r--app/workers/namespaceless_project_destroy_worker.rb42
1 files changed, 0 insertions, 42 deletions
diff --git a/app/workers/namespaceless_project_destroy_worker.rb b/app/workers/namespaceless_project_destroy_worker.rb
deleted file mode 100644
index c2ed379be48..00000000000
--- a/app/workers/namespaceless_project_destroy_worker.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-# frozen_string_literal: true
-
-# Worker to destroy projects that do not have a namespace
-#
-# It destroys everything it can without having the info about the namespace it
-# used to belong to. Projects in this state should be rare.
-# The worker will reject doing anything for projects that *do* have a
-# namespace. For those use ProjectDestroyWorker instead.
-class NamespacelessProjectDestroyWorker # rubocop:disable Scalability/IdempotentWorker
- include ApplicationWorker
-
- data_consistency :always
-
- sidekiq_options retry: 3
- include ExceptionBacktrace
-
- feature_category :authentication_and_authorization
-
- def perform(project_id)
- begin
- project = Project.unscoped.find(project_id)
- rescue ActiveRecord::RecordNotFound
- return
- end
-
- return if project.namespace # Reject doing anything for projects that *do* have a namespace
-
- project.team.truncate
-
- unlink_fork(project) if project.forked?
-
- project.destroy!
- end
-
- private
-
- def unlink_fork(project)
- merge_requests = project.forked_from_project.merge_requests.opened.from_project(project)
-
- merge_requests.update_all(state_id: MergeRequest.available_states[:closed])
- end
-end