summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/feature.rb8
-rw-r--r--lib/gitlab/performance_bar.rb13
2 files changed, 3 insertions, 18 deletions
diff --git a/lib/feature.rb b/lib/feature.rb
index c4e1741df52..363f66ba60e 100644
--- a/lib/feature.rb
+++ b/lib/feature.rb
@@ -57,13 +57,5 @@ class Feature
Flipper.new(adapter)
end
end
-
- def register_feature_groups
- Flipper.register(:performance_team) do |actor|
- user = actor.thing
-
- user&.is_a?(User) && Gitlab::PerformanceBar.allowed_user?(user)
- end
- end
end
end
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