diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2017-11-02 17:52:17 +0100 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2017-11-02 17:52:17 +0100 |
commit | 94d5f5680e398ddfe0cc621bde00dfb5c8a39d03 (patch) | |
tree | 8e5fd7c50de308a93fd218fc962ca81c70b24326 /app/workers | |
parent | a8d7e4bcb13e24426a531ef37d573e24d2547b81 (diff) | |
download | gitlab-ce-94d5f5680e398ddfe0cc621bde00dfb5c8a39d03.tar.gz |
Extract ClusterWaitForAppInstallationWorker logic into a service
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/cluster_wait_for_app_installation_worker.rb | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/app/workers/cluster_wait_for_app_installation_worker.rb b/app/workers/cluster_wait_for_app_installation_worker.rb index 21149cf2d19..7e480c42fd4 100644 --- a/app/workers/cluster_wait_for_app_installation_worker.rb +++ b/app/workers/cluster_wait_for_app_installation_worker.rb @@ -9,25 +9,7 @@ class ClusterWaitForAppInstallationWorker def perform(app_name, app_id) find_app(app_name, app_id) do |app| - Clusters::FetchAppInstallationStatusService.new(app).execute do |phase, log| - case phase - when 'Succeeded' - if app.make_installed - Clusters::FinalizeAppInstallationService.new(app).execute - else - app.make_errored!("Failed to update app record; #{app.errors}") - end - when 'Failed' - app.make_errored!(log || 'Installation silently failed') - Clusters::FinalizeAppInstallationService.new(app).execute - else - if Time.now.utc - app.updated_at.to_time.utc > TIMEOUT - app.make_errored!('App installation timeouted') - else - ClusterWaitForAppInstallationWorker.perform_in(EAGER_INTERVAL, app.name, app.id) - end - end - end + Clusters::CheckAppInstallationProgressService.new(app).execute end end end |