Refactor Feature.flipper method

This commit is contained in:
Douglas Barbosa Alexandre 2018-10-05 11:20:19 -03:00
parent 88fa9a3c31
commit 75ddf0d48d
No known key found for this signature in database
GPG key ID: F1E98EF6393565A0

View file

@ -72,7 +72,11 @@ class Feature
end
def flipper
@flipper ||= (Gitlab::SafeRequestStore[:flipper] ||= build_flipper_instance)
if Gitlab::SafeRequestStore.active?
Gitlab::SafeRequestStore[:flipper] ||= build_flipper_instance
else
@flipper ||= build_flipper_instance
end
end
def build_flipper_instance