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

active_support_cache_store_adapter.rb « feature « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ae2d623abe1659f53872f14fbb6b9922841bb311 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true

# rubocop:disable Gitlab/NamespacedClass
# This class was already nested this way before moving to a separate file
class Feature
  class ActiveSupportCacheStoreAdapter < Flipper::Adapters::ActiveSupportCacheStore
    def enable(feature, gate, thing)
      result = @adapter.enable(feature, gate, thing)
      @cache.write(key_for(feature.key), @adapter.get(feature), @write_options)
      result
    end

    def disable(feature, gate, thing)
      result = @adapter.disable(feature, gate, thing)
      @cache.write(key_for(feature.key), @adapter.get(feature), @write_options)
      result
    end

    def remove(feature)
      result = @adapter.remove(feature)
      @cache.delete(FeaturesKey)
      @cache.write(key_for(feature.key), {}, @write_options)
      result
    end
  end
end
# rubocop:disable Gitlab/NamespacedClass