summaryrefslogtreecommitdiff
path: root/app/workers
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-07-26 12:49:54 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-07-26 12:49:54 +0000
commit5de3ec64da3f7154f72413ae12d2e13935533f2b (patch)
treeb921866293f9aaa520cb058f195e91e079e6521e /app/workers
parentd29598e69190d6bc3a7d3cea44892d2db69d20e0 (diff)
parentb5bdc55d239f3e19f8fe1e59b118da05ac81a0dd (diff)
downloadgitlab-ce-5de3ec64da3f7154f72413ae12d2e13935533f2b.tar.gz
Merge branch '29289-project-destroy-clean-up-after-failure' into 'master'
Handle errors while a project is being deleted asynchronously. Closes #29289 See merge request !11088
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/project_destroy_worker.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/app/workers/project_destroy_worker.rb b/app/workers/project_destroy_worker.rb
index b462327490e..a9188b78460 100644
--- a/app/workers/project_destroy_worker.rb
+++ b/app/workers/project_destroy_worker.rb
@@ -3,14 +3,11 @@ class ProjectDestroyWorker
include DedicatedSidekiqQueue
def perform(project_id, user_id, params)
- begin
- project = Project.unscoped.find(project_id)
- rescue ActiveRecord::RecordNotFound
- return
- end
-
+ project = Project.find(project_id)
user = User.find(user_id)
::Projects::DestroyService.new(project, user, params.symbolize_keys).execute
+ rescue ActiveRecord::RecordNotFound => error
+ logger.error("Failed to delete project (#{project_id}): #{error.message}")
end
end