summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsh McKenzie <amckenzie@gitlab.com>2019-06-24 01:37:15 +0000
committerAsh McKenzie <amckenzie@gitlab.com>2019-06-24 01:37:15 +0000
commit6875796c95471c7706b25a142b1eb815ef3d2ad1 (patch)
tree7da00f3991669cd5232a32a7d76b501765291e36
parentd6b9f61d4b7d3fa1ad9875289b8b26c77a4f95d9 (diff)
parent3129cbd555ef6770eb859614c08cc854ec07175f (diff)
downloadgitlab-ce-6875796c95471c7706b25a142b1eb815ef3d2ad1.tar.gz
Merge branch 'reduce_prometheus_adapter' into 'master'
Improve #has_metrics? and Environment#has_terminals? See merge request gitlab-org/gitlab-ce!29847
-rw-r--r--app/models/deployment.rb2
-rw-r--r--app/models/environment.rb4
2 files changed, 3 insertions, 3 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
diff --git a/app/models/environment.rb b/app/models/environment.rb
index aff20dae09b..1f7e8815c8e 100644
--- a/app/models/environment.rb
+++ b/app/models/environment.rb
@@ -155,7 +155,7 @@ class Environment < ApplicationRecord
end
def has_terminals?
- deployment_platform.present? && available? && last_deployment.present?
+ available? && deployment_platform.present? && last_deployment.present?
end
def terminals
@@ -163,7 +163,7 @@ class Environment < ApplicationRecord
end
def has_metrics?
- prometheus_adapter&.can_query? && available?
+ available? && prometheus_adapter&.can_query?
end
def metrics