Prefer to use `.tap` as `.try` hides an exceptions from workers
This commit is contained in:
parent
f916424381
commit
7e3e8ae81b
|
@ -7,11 +7,11 @@ class WaitForClusterCreationWorker
|
|||
TIMEOUT = 20.minutes
|
||||
|
||||
def perform(cluster_id)
|
||||
Gcp::Cluster.find_by_id(cluster_id).try do |cluster|
|
||||
Gcp::Cluster.find_by_id(cluster_id).tap do |cluster|
|
||||
Ci::FetchGcpOperationService.new.execute(cluster) do |operation|
|
||||
case operation.status
|
||||
when 'RUNNING'
|
||||
if TIMEOUT < Time.now - operation.start_time.to_time
|
||||
if TIMEOUT < Time.zone.now - operation.start_time.to_time
|
||||
return cluster.errored!("Cluster creation time exceeds timeout; #{TIMEOUT}")
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue