diff options
author | Dylan Griffith <dyl.griffith@gmail.com> | 2018-02-23 09:08:12 +1100 |
---|---|---|
committer | Dylan Griffith <dyl.griffith@gmail.com> | 2018-02-23 09:10:14 +1100 |
commit | 3b320d675fe058311d921e26cd89b2e703310b21 (patch) | |
tree | c8135b9041f238bc2d435fea26cf3c3dd6940cd8 /app/workers | |
parent | 17e85dacdd73b51a173d1f4c5efea5e20ee8c55b (diff) | |
download | gitlab-ce-3b320d675fe058311d921e26cd89b2e703310b21.tar.gz |
Simplify retrying for ClusterWaitForIngressIpAddressWorker and style changes
(#42643)
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/cluster_wait_for_ingress_ip_address_worker.rb | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/app/workers/cluster_wait_for_ingress_ip_address_worker.rb b/app/workers/cluster_wait_for_ingress_ip_address_worker.rb index 0fbb9fb2526..72b3c8b49e0 100644 --- a/app/workers/cluster_wait_for_ingress_ip_address_worker.rb +++ b/app/workers/cluster_wait_for_ingress_ip_address_worker.rb @@ -3,23 +3,11 @@ class ClusterWaitForIngressIpAddressWorker include ClusterQueue include ClusterApplications - INTERVAL = 10.seconds + INTERVAL = 30.seconds def perform(app_name, app_id, retries_remaining) find_application(app_name, app_id) do |app| - result = Clusters::Applications::CheckIngressIpAddressService.new(app).execute - retry_if_necessary(app_name, app_id, retries_remaining) unless result - end - rescue Clusters::Applications::CheckIngressIpAddressService::Error => e - retry_if_necessary(app_name, app_id, retries_remaining) - raise e - end - - private - - def retry_if_necessary(app_name, app_id, retries_remaining) - if retries_remaining > 0 - self.class.perform_in(INTERVAL, app_name, app_id, retries_remaining - 1) + Clusters::Applications::CheckIngressIpAddressService.new(app).execute end end end |