diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2017-07-06 16:43:07 +0300 |
---|---|---|
committer | Tiago Botelho <tiagonbotelho@hotmail.com> | 2017-07-20 11:59:56 +0300 |
commit | 0aa8249e484ca97cfc28c7301d69077919032c08 (patch) | |
tree | 347640b916c5064d014bb34fe54dafa1230191ca /app/workers/project_destroy_worker.rb | |
parent | 3491b19a4e67a9f439c12afac45ef38f3fce0ef5 (diff) |
Refactors Project Destroy service and worker code
Diffstat (limited to 'app/workers/project_destroy_worker.rb')
-rw-r--r-- | app/workers/project_destroy_worker.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/app/workers/project_destroy_worker.rb b/app/workers/project_destroy_worker.rb index 209cf11e893..e695ec060f0 100644 --- a/app/workers/project_destroy_worker.rb +++ b/app/workers/project_destroy_worker.rb @@ -7,10 +7,7 @@ class ProjectDestroyWorker user = User.find(user_id) ::Projects::DestroyService.new(project, user, params.symbolize_keys).execute - rescue Exception => error # rubocop:disable Lint/RescueException - project&.update_attributes(delete_error: error.message, pending_delete: false) - Rails.logger.error("Deletion failed on #{project&.full_path} with the following message: #{error.message}") - - raise + rescue ActiveRecord::RecordNotFound => error + logger.error("Failed to delete project #{project.path_with_namespace} (#{project.id}): #{error.message}") end end |