summaryrefslogtreecommitdiff
path: root/lib/feature.rb
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2018-09-20 12:32:54 -0700
committerMichael Kozono <mkozono@gmail.com>2018-09-24 12:11:26 -0700
commitf107bc69e34f79ea8faaa154caefe56948b8dd68 (patch)
tree60e65bdf6fd939d3d15113fd1f7a53c12038e5dc /lib/feature.rb
parent45cf64c827270d66a88d483bb3f9043a90301255 (diff)
downloadgitlab-ce-f107bc69e34f79ea8faaa154caefe56948b8dd68.tar.gz
Simplify by using Gitlab::SafeRequestStore
These are clear wins.
Diffstat (limited to 'lib/feature.rb')
-rw-r--r--lib/feature.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/feature.rb b/lib/feature.rb
index f4b57376313..a8324d99c10 100644
--- a/lib/feature.rb
+++ b/lib/feature.rb
@@ -28,11 +28,7 @@ class Feature
end
def persisted_names
- if RequestStore.active?
- RequestStore[:flipper_persisted_names] ||= FlipperFeature.feature_names
- else
- FlipperFeature.feature_names
- end
+ Gitlab::SafeRequestStore[:flipper_persisted_names] ||= FlipperFeature.feature_names
end
def persisted?(feature)
@@ -76,8 +72,8 @@ class Feature
end
def flipper
- if RequestStore.active?
- RequestStore[:flipper] ||= build_flipper_instance
+ if Gitlab::SafeRequestStore.active?
+ Gitlab::SafeRequestStore[:flipper] ||= build_flipper_instance
else
@flipper ||= build_flipper_instance
end