summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Mack <jmacktdkc@gmail.com>2011-12-16 09:51:38 -0500
committerJeremy Mack <jmacktdkc@gmail.com>2011-12-16 09:59:43 -0500
commit0bd7f91c6608e7cd72349c89494103aed40be22d (patch)
tree8e1959d7ee2a04e00bea169f3821181e5e394f2b
parentca4e2ad135061150bb47ec229bed52a25fa49f75 (diff)
downloadgitlab-ce-0bd7f91c6608e7cd72349c89494103aed40be22d.tar.gz
Project destroy relationship speed fix
Removes destroy callback for users_projects when a project is destroyed. This works okay becaues the gitolite config will be updated at at the end to remove the entry entirely, thereby removing the users anyway.
-rw-r--r--app/controllers/projects_controller.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 1f1da559abf..5f4f2524327 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -93,7 +93,11 @@ class ProjectsController < ApplicationController
end
def destroy
+ # Disable the UsersProject update_repository call, otherwise it will be
+ # called once for every person removed from the project
+ UsersProject.skip_callback(:destroy, :after, :update_repository)
project.destroy
+ UsersProject.set_callback(:destroy, :after, :update_repository)
respond_to do |format|
format.html { redirect_to projects_url }