Skip to content
Snippets Groups Projects
Commit 233cf070 authored by Dylan Griffith's avatar Dylan Griffith
Browse files

Remove redundant code and increase delay for ClusterWaitForIngressIpAddressWorker (#42643)

parent 20897ebc
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -14,13 +14,13 @@ module Clusters
nginx: 1
}
 
IP_ADDRESS_FETCH_RETRIES = 3
FETCH_IP_ADDRESS_DELAY = 30.seconds
 
state_machine :status do
before_transition any => [:installed] do |application|
application.run_after_commit do
ClusterWaitForIngressIpAddressWorker.perform_in(
ClusterWaitForIngressIpAddressWorker::INTERVAL, application.name, application.id, IP_ADDRESS_FETCH_RETRIES)
FETCH_IP_ADDRESS_DELAY, application.name, application.id)
end
end
end
Loading
Loading
@@ -41,8 +41,7 @@ module Clusters
return unless installed?
return if external_ip
 
ClusterWaitForIngressIpAddressWorker.perform_async(
name, id, IP_ADDRESS_FETCH_RETRIES)
ClusterWaitForIngressIpAddressWorker.perform_async(name, id)
end
end
end
Loading
Loading
Loading
Loading
@@ -3,9 +3,7 @@ class ClusterWaitForIngressIpAddressWorker
include ClusterQueue
include ClusterApplications
 
INTERVAL = 30.seconds
def perform(app_name, app_id, retries_remaining)
def perform(app_name, app_id)
find_application(app_name, app_id) do |app|
Clusters::Applications::CheckIngressIpAddressService.new(app).execute
end
Loading
Loading
Loading
Loading
@@ -20,7 +20,7 @@ describe Clusters::Applications::Ingress do
 
it 'schedules a ClusterWaitForIngressIpAddressWorker' do
expect(ClusterWaitForIngressIpAddressWorker).to have_received(:perform_in)
.with(ClusterWaitForIngressIpAddressWorker::INTERVAL, 'ingress', application.id, 3)
.with(Clusters::Applications::Ingress::FETCH_IP_ADDRESS_DELAY, 'ingress', application.id)
end
end
 
Loading
Loading
@@ -33,7 +33,7 @@ describe Clusters::Applications::Ingress do
 
it 'schedules a ClusterWaitForIngressIpAddressWorker' do
expect(ClusterWaitForIngressIpAddressWorker).to have_received(:perform_async)
.with('ingress', application.id, 3)
.with('ingress', application.id)
end
 
context 'when the application is not installed' do
Loading
Loading
Loading
Loading
@@ -22,7 +22,7 @@ describe ClusterWaitForIngressIpAddressWorker do
end
 
it 'finds the application and calls CheckIngressIpAddressService#execute' do
worker.perform('ingress', 117, 2)
worker.perform('ingress', 117)
 
expect(service).to have_received(:execute)
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment