diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-10-03 23:25:23 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-10-03 23:25:23 +0200 |
commit | 7e3e8ae81b7d20db718ff3b3afb27e6b92496af7 (patch) | |
tree | 73ab32d719baa390915cfa1bc2577a950d16102b /app | |
parent | f916424381c1e56f7975af488dc404051a827144 (diff) | |
download | gitlab-ce-7e3e8ae81b7d20db718ff3b3afb27e6b92496af7.tar.gz |
Prefer to use `.tap` as `.try` hides an exceptions from workers
Diffstat (limited to 'app')
-rw-r--r-- | app/workers/wait_for_cluster_creation_worker.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/workers/wait_for_cluster_creation_worker.rb b/app/workers/wait_for_cluster_creation_worker.rb index 3b9978e986a..aa1cd84fa8c 100644 --- a/app/workers/wait_for_cluster_creation_worker.rb +++ b/app/workers/wait_for_cluster_creation_worker.rb @@ -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 |