Commit 5f2dc999 authored by Pawel Chojnacki's avatar Pawel Chojnacki

use proper `if defined?` check.

parent ed5c7d11
...@@ -6,12 +6,15 @@ module Gitlab ...@@ -6,12 +6,15 @@ module Gitlab
include Gitlab::CurrentSettings include Gitlab::CurrentSettings
def metrics_folder_present? def metrics_folder_present?
ENV.has_key?('prometheus_multiproc_dir') && ::Dir.exist?(ENV['prometheus_multiproc_dir']) && ENV.has_key?('prometheus_multiproc_dir') &&
::Dir.exist?(ENV['prometheus_multiproc_dir']) &&
::File.writable?(ENV['prometheus_multiproc_dir']) ::File.writable?(ENV['prometheus_multiproc_dir'])
end end
def prometheus_metrics_enabled? def prometheus_metrics_enabled?
@prometheus_metrics_enabled ||= prometheus_metrics_enabled_unmemoized return @prometheus_metrics_enabled if defined?(@prometheus_metrics_enabled)
@prometheus_metrics_enabled = prometheus_metrics_enabled_unmemoized
end end
def registry def registry
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment