Commit 27359dbf authored by Pawel Chojnacki's avatar Pawel Chojnacki

use class variable for Mutex instead of Const

parent 83ae1721
# rubocop:disable Style/ClassVars
module Gitlab
module Metrics
module Concern
extend ActiveSupport::Concern
MUTEX = Mutex.new
included do
@@_metric_provider_mutex = Mutex.new
end
class_methods do
def reload_metric!(name)
......@@ -37,7 +42,7 @@ module Gitlab
end
def synchronized_cache_fill(key)
MUTEX.synchronize do
@@_metric_provider_mutex.synchronize do
@_metrics_provider_cache ||= {}
@_metrics_provider_cache[key] ||= yield
end
......
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