summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-08-06 07:25:51 -0700
committerStan Hu <stanhu@gmail.com>2016-08-10 09:28:21 -0700
commit4955a47cb1c52168114364e45a2fccf6bc105452 (patch)
tree50bb5ea1979a596edef53817aea75796686fc2a9 /app/models/project.rb
parentae2d3c417075c83e169ab7662f3dd11e3b2bf043 (diff)
downloadgitlab-ce-4955a47cb1c52168114364e45a2fccf6bc105452.tar.gz
Clean up project destructionclean-up-project-destroy
Instead of redirecting from the project service to the service and back to the model, put all destruction code in the service. Also removes a possible source of failure where run_after_commit may not destroy the project.
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb10
1 files changed, 0 insertions, 10 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index d306f86f783..3b1a53edc75 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1161,16 +1161,6 @@ class Project < ActiveRecord::Base
@wiki ||= ProjectWiki.new(self, self.owner)
end
- def schedule_delete!(user_id, params)
- # Queue this task for after the commit, so once we mark pending_delete it will run
- run_after_commit do
- job_id = ProjectDestroyWorker.perform_async(id, user_id, params)
- Rails.logger.info("User #{user_id} scheduled destruction of project #{path_with_namespace} with job ID #{job_id}")
- end
-
- update_attribute(:pending_delete, true)
- end
-
def running_or_pending_build_count(force: false)
Rails.cache.fetch(['projects', id, 'running_or_pending_build_count'], force: force) do
builds.running_or_pending.count(:all)