diff options
author | Michael Kozono <mkozono@gmail.com> | 2018-09-20 12:32:54 -0700 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2018-09-24 12:11:26 -0700 |
commit | f107bc69e34f79ea8faaa154caefe56948b8dd68 (patch) | |
tree | 60e65bdf6fd939d3d15113fd1f7a53c12038e5dc /lib/feature.rb | |
parent | 45cf64c827270d66a88d483bb3f9043a90301255 (diff) | |
download | gitlab-ce-f107bc69e34f79ea8faaa154caefe56948b8dd68.tar.gz |
Simplify by using Gitlab::SafeRequestStore
These are clear wins.
Diffstat (limited to 'lib/feature.rb')
-rw-r--r-- | lib/feature.rb | 10 |
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 |