Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessio Caiazza <acaiazza@gitlab.com>2017-11-02 19:52:17 +0300
committerAlessio Caiazza <acaiazza@gitlab.com>2017-11-02 19:52:17 +0300
commit94d5f5680e398ddfe0cc621bde00dfb5c8a39d03 (patch)
tree8e5fd7c50de308a93fd218fc962ca81c70b24326 /app/workers
parenta8d7e4bcb13e24426a531ef37d573e24d2547b81 (diff)
Extract ClusterWaitForAppInstallationWorker logic into a service
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/cluster_wait_for_app_installation_worker.rb20
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