Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2019-06-19 14:56:47 +0300
committerThong Kuah <tkuah@gitlab.com>2019-06-19 15:02:29 +0300
commite99a55ffa775179da2868624c4811459f996cb02 (patch)
tree61db01f49733e763fd4bc488b1bc3c54f7a37a9f /app/models/environment.rb
parent6fa900547dbd30b0db0070f87dbeb4b05d485b9b (diff)
Run least expensive method first
If environment is not available, then no point running the more expensive `prometheus_adapter`.
Diffstat (limited to 'app/models/environment.rb')
-rw-r--r--app/models/environment.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb
index aff20dae09b..09ab8e61a51 100644
--- a/app/models/environment.rb
+++ b/app/models/environment.rb
@@ -163,7 +163,7 @@ class Environment < ApplicationRecord
end
def has_metrics?
- prometheus_adapter&.can_query? && available?
+ available? && prometheus_adapter&.can_query?
end
def metrics