summaryrefslogtreecommitdiff
path: root/lib/gitlab/performance_bar.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/performance_bar.rb')
-rw-r--r--lib/gitlab/performance_bar.rb13
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/gitlab/performance_bar.rb b/lib/gitlab/performance_bar.rb
index aa033571de0..2da2ce45ebc 100644
--- a/lib/gitlab/performance_bar.rb
+++ b/lib/gitlab/performance_bar.rb
@@ -3,16 +3,9 @@ module Gitlab
include Gitlab::CurrentSettings
ALLOWED_USER_IDS_KEY = 'performance_bar_allowed_user_ids'.freeze
- # The time (in seconds) after which a set of allowed user IDs is expired
- # automatically.
- ALLOWED_USER_IDS_TIME_TO_LIVE = 10.minutes
- def self.enabled?(current_user = nil)
- Feature.enabled?(:performance_bar, current_user)
- end
-
- def self.allowed_user?(user)
- return false unless allowed_group_id
+ def self.enabled?(user = nil)
+ return false unless user && allowed_group_id
allowed_user_ids.include?(user.id)
end
@@ -22,7 +15,7 @@ module Gitlab
end
def self.allowed_user_ids
- Rails.cache.fetch(ALLOWED_USER_IDS_KEY, expires_in: ALLOWED_USER_IDS_TIME_TO_LIVE) do
+ Rails.cache.fetch(ALLOWED_USER_IDS_KEY) do
group = Group.find_by_id(allowed_group_id)
if group