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:
Diffstat (limited to 'lib/feature/active_support_cache_store_adapter.rb')
-rw-r--r--lib/feature/active_support_cache_store_adapter.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/feature/active_support_cache_store_adapter.rb b/lib/feature/active_support_cache_store_adapter.rb
index ae2d623abe1..431f1169a86 100644
--- a/lib/feature/active_support_cache_store_adapter.rb
+++ b/lib/feature/active_support_cache_store_adapter.rb
@@ -4,18 +4,27 @@
# This class was already nested this way before moving to a separate file
class Feature
class ActiveSupportCacheStoreAdapter < Flipper::Adapters::ActiveSupportCacheStore
+ # This patch represents https://github.com/jnunemaker/flipper/pull/512. In
+ # Flipper 0.21.0 and later, we can remove this and just pass `write_through:
+ # true` to the constructor in `Feature.build_flipper_instance`.
+
+ extend ::Gitlab::Utils::Override
+
+ override :enable
def enable(feature, gate, thing)
result = @adapter.enable(feature, gate, thing)
@cache.write(key_for(feature.key), @adapter.get(feature), @write_options)
result
end
+ override :disable
def disable(feature, gate, thing)
result = @adapter.disable(feature, gate, thing)
@cache.write(key_for(feature.key), @adapter.get(feature), @write_options)
result
end
+ override :remove
def remove(feature)
result = @adapter.remove(feature)
@cache.delete(FeaturesKey)