diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2019-03-04 21:44:46 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2019-03-04 21:44:46 +0300 |
commit | 59db98a0cabea4421434655d7f7873110363d21a (patch) | |
tree | f3f72bca43724e230090aeae7aa0c15e56b707bf /app/models/project_services | |
parent | 5c80bbb33c12490bc5fa711642a40fc16bdb79a4 (diff) | |
parent | 025015048f7eaad29ee7816c6040fb3e0c06eb8d (diff) |
Merge dev master into GitLab.com master
Diffstat (limited to 'app/models/project_services')
-rw-r--r-- | app/models/project_services/prometheus_service.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/project_services/prometheus_service.rb b/app/models/project_services/prometheus_service.rb index 60cb2d380d5..c68a9d923c8 100644 --- a/app/models/project_services/prometheus_service.rb +++ b/app/models/project_services/prometheus_service.rb @@ -71,7 +71,7 @@ class PrometheusService < MonitoringService end def prometheus_client - RestClient::Resource.new(api_url, max_redirects: 0) if api_url && manual_configuration? && active? + RestClient::Resource.new(api_url, max_redirects: 0) if should_return_client? end def prometheus_available? @@ -83,6 +83,10 @@ class PrometheusService < MonitoringService private + def should_return_client? + api_url && manual_configuration? && active? && valid? + end + def synchronize_service_state self.active = prometheus_available? || manual_configuration? |