summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-06-08 13:33:51 -0700
committerStan Hu <stanhu@gmail.com>2018-06-08 13:33:51 -0700
commit20923257407d705fee0d5b3238f441402214f8cd (patch)
treeba89176c0755c0965acf9b8ee2c78bfa8508c835
parentc7dfbb9989195efa4af2d0baa5216fcdb3228e8e (diff)
downloadgitlab-ce-20923257407d705fee0d5b3238f441402214f8cd.tar.gz
Add more logging before a project is destroyed
This adds a simple log message but also allows EE to insert database events within the transaction (https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6059/diffs).
-rw-r--r--app/services/projects/destroy_service.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/services/projects/destroy_service.rb b/app/services/projects/destroy_service.rb
index de0125ed0dd..02769e72229 100644
--- a/app/services/projects/destroy_service.rb
+++ b/app/services/projects/destroy_service.rb
@@ -135,6 +135,7 @@ module Projects
raise_error('Failed to remove some tags in project container registry. Please try again or contact administrator.')
end
+ log_destroy_event
trash_repositories!
# Rails attempts to load all related records into memory before
@@ -148,6 +149,10 @@ module Projects
end
end
+ def log_destroy_event
+ log_info("Attempting to destroy #{project.full_path} (#{project.id})")
+ end
+
##
# This method makes sure that we correctly remove registry tags
# for legacy image repository (when repository path equals project path).