diff options
author | João Cunha <j.a.cunha@gmail.com> | 2019-03-06 11:50:39 +0000 |
---|---|---|
committer | João Cunha <j.a.cunha@gmail.com> | 2019-03-06 11:50:39 +0000 |
commit | 34d837b575350b98a8d3809556a07473ba7d0d54 (patch) | |
tree | 091269bdb88aeb45843a3072e15e8f76eb683abd | |
parent | 70e443014ae3577d6ab17d87e4346cab75d217bd (diff) | |
download | gitlab-ce-34d837b575350b98a8d3809556a07473ba7d0d54.tar.gz |
Remove unecessary begin..end block
-rw-r--r-- | app/services/clusters/applications/install_service.rb | 22 | ||||
-rw-r--r-- | app/services/clusters/applications/patch_service.rb | 22 |
2 files changed, 20 insertions, 24 deletions
diff --git a/app/services/clusters/applications/install_service.rb b/app/services/clusters/applications/install_service.rb index 5a65dc4ef59..5bd3623a558 100644 --- a/app/services/clusters/applications/install_service.rb +++ b/app/services/clusters/applications/install_service.rb @@ -6,19 +6,17 @@ module Clusters def execute return unless app.scheduled? - begin - app.make_installing! - helm_api.install(install_command) + app.make_installing! + helm_api.install(install_command) - ClusterWaitForAppInstallationWorker.perform_in( - ClusterWaitForAppInstallationWorker::INTERVAL, app.name, app.id) - rescue Kubeclient::HttpError => e - log_error(e) - app.make_errored!("Kubernetes error: #{e.error_code}") - rescue StandardError => e - log_error(e) - app.make_errored!("Can't start installation process.") - end + ClusterWaitForAppInstallationWorker.perform_in( + ClusterWaitForAppInstallationWorker::INTERVAL, app.name, app.id) + rescue Kubeclient::HttpError => e + log_error(e) + app.make_errored!("Kubernetes error: #{e.error_code}") + rescue StandardError => e + log_error(e) + app.make_errored!("Can't start installation process.") end end end diff --git a/app/services/clusters/applications/patch_service.rb b/app/services/clusters/applications/patch_service.rb index 67fc8fd9800..20c739af7a2 100644 --- a/app/services/clusters/applications/patch_service.rb +++ b/app/services/clusters/applications/patch_service.rb @@ -6,20 +6,18 @@ module Clusters def execute return unless app.scheduled? - begin - app.make_updating! + app.make_updating! - helm_api.update(update_command) + helm_api.update(update_command) - ClusterWaitForAppInstallationWorker.perform_in( - ClusterWaitForAppInstallationWorker::INTERVAL, app.name, app.id) - rescue Kubeclient::HttpError => e - log_error(e) - app.make_update_errored!("Kubernetes error: #{e.error_code}") - rescue StandardError => e - log_error(e) - app.make_update_errored!("Can't start update process.") - end + ClusterWaitForAppInstallationWorker.perform_in( + ClusterWaitForAppInstallationWorker::INTERVAL, app.name, app.id) + rescue Kubeclient::HttpError => e + log_error(e) + app.make_update_errored!("Kubernetes error: #{e.error_code}") + rescue StandardError => e + log_error(e) + app.make_update_errored!("Can't start update process.") end end end |