summaryrefslogtreecommitdiff
path: root/app/workers
diff options
context:
space:
mode:
authorDylan Griffith <dyl.griffith@gmail.com>2018-02-23 09:08:12 +1100
committerDylan Griffith <dyl.griffith@gmail.com>2018-02-23 09:10:14 +1100
commit3b320d675fe058311d921e26cd89b2e703310b21 (patch)
treec8135b9041f238bc2d435fea26cf3c3dd6940cd8 /app/workers
parent17e85dacdd73b51a173d1f4c5efea5e20ee8c55b (diff)
downloadgitlab-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.rb16
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