Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-07-07 03:34:51 +0300
committerRémy Coutable <remy@rymai.me>2017-07-07 03:34:51 +0300
commit97611c88fcbae6b025750e6ebf2061a3d87d9753 (patch)
tree1d4ff635a807a49f99af219dc83c265a3465a4a6 /lib/gitlab/performance_bar.rb
parent040eeb1039b4298ea56a670a0a4ae511288806d6 (diff)
Don't use Flipper for the Performance Bar
The implementation now simply rely on the `performance_bar_allowed_group_id` Application Setting. Signed-off-by: Rémy Coutable <remy@rymai.me>
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