Commit 34d837b5 authored by João Cunha's avatar João Cunha

Remove unecessary begin..end block

parent 70e44301
...@@ -6,19 +6,17 @@ module Clusters ...@@ -6,19 +6,17 @@ module Clusters
def execute def execute
return unless app.scheduled? return unless app.scheduled?
begin app.make_installing!
app.make_installing! helm_api.install(install_command)
helm_api.install(install_command)
ClusterWaitForAppInstallationWorker.perform_in( ClusterWaitForAppInstallationWorker.perform_in(
ClusterWaitForAppInstallationWorker::INTERVAL, app.name, app.id) ClusterWaitForAppInstallationWorker::INTERVAL, app.name, app.id)
rescue Kubeclient::HttpError => e rescue Kubeclient::HttpError => e
log_error(e) log_error(e)
app.make_errored!("Kubernetes error: #{e.error_code}") app.make_errored!("Kubernetes error: #{e.error_code}")
rescue StandardError => e rescue StandardError => e
log_error(e) log_error(e)
app.make_errored!("Can't start installation process.") app.make_errored!("Can't start installation process.")
end
end end
end end
end end
......
...@@ -6,20 +6,18 @@ module Clusters ...@@ -6,20 +6,18 @@ module Clusters
def execute def execute
return unless app.scheduled? 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.perform_in(
ClusterWaitForAppInstallationWorker::INTERVAL, app.name, app.id) ClusterWaitForAppInstallationWorker::INTERVAL, app.name, app.id)
rescue Kubeclient::HttpError => e rescue Kubeclient::HttpError => e
log_error(e) log_error(e)
app.make_update_errored!("Kubernetes error: #{e.error_code}") app.make_update_errored!("Kubernetes error: #{e.error_code}")
rescue StandardError => e rescue StandardError => e
log_error(e) log_error(e)
app.make_update_errored!("Can't start update process.") app.make_update_errored!("Can't start update process.")
end
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment