summaryrefslogtreecommitdiff
path: root/app/models/deployment.rb
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2019-06-20 14:25:31 +1200
committerThong Kuah <tkuah@gitlab.com>2019-06-20 16:38:27 +1200
commit3129cbd555ef6770eb859614c08cc854ec07175f (patch)
treecfb66e7267c311c41f2b1dc89fc744c60010b7d4 /app/models/deployment.rb
parent65b6a37fa6656fe2956a6a66011a6630545af229 (diff)
downloadgitlab-ce-3129cbd555ef6770eb859614c08cc854ec07175f.tar.gz
Run least expensive method first - has_metrics?reduce_prometheus_adapter
Success is relatively cheap compared to prometheus_adapter which can invoke deployment_platform which does a lot of work
Diffstat (limited to 'app/models/deployment.rb')
-rw-r--r--app/models/deployment.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/deployment.rb b/app/models/deployment.rb
index 92c7311014a..ee6e830d3ec 100644
--- a/app/models/deployment.rb
+++ b/app/models/deployment.rb
@@ -179,7 +179,7 @@ class Deployment < ApplicationRecord
end
def has_metrics?
- prometheus_adapter&.can_query? && success?
+ success? && prometheus_adapter&.can_query?
end
def metrics