flipper-active_support_cache_store 1.3.4 → 1.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 417f9c340d72923c26ddbf1eceb7a527cf4dff543fd7baa2ef64d3a2780cfaa3
4
- data.tar.gz: 87f8e3b6299f8a670aff3428fe86a4a55ed82dedd13f4d8ec44cbd71ae284ff1
3
+ metadata.gz: a7b5c9414cd4c0a7af95ab90873d6830a19e4befda24d8f22b395f88a3fc63c5
4
+ data.tar.gz: b64460a641c23b702de19f27e7996643a5b8f2caf32aee9949369762c52ae6af
5
5
  SHA512:
6
- metadata.gz: febc357aeb4b7f10b3578a7d5270bf31054e21903ec7fea04db2ad17eee508a3a20c6e6616e66fb1b9427fa73e7ee1e398322fa6bf730a749c751a48a6c56d5b
7
- data.tar.gz: b9ef79a7d33cb10f5f5d0d0bb12828d21d96fe4f7444cfcd6bb173333c3faba27967167fb63eb5b54ba556db9d27e100e9f4dfc26cfc2fc4b519d6730dca0f31
6
+ metadata.gz: fc8c1e1f151f8d40dfe64bea6627f9724e5ce65b091ffe2972378eacb6c29beb8a1984f408d6e2df3c550525361e318ddd924935ba548f9aaed1b2c54836b9ff
7
+ data.tar.gz: d032cce0605787fc4ff38cc4537088ef607d927b8d38826e9f0904f17141e460495e39b4f7351f1a27d2fe1c75e692fc844ef733541916d42beaed864ae7234a
@@ -7,7 +7,11 @@ module Flipper
7
7
  # Public: Adapter that wraps another adapter with the ability to cache
8
8
  # adapter calls in ActiveSupport::ActiveSupportCacheStore caches.
9
9
  class ActiveSupportCacheStore < CacheBase
10
- def initialize(adapter, cache, ttl = nil, expires_in: :none_provided, write_through: false, prefix: nil)
10
+
11
+ # Public: The race_condition_ttl for all cached data.
12
+ attr_reader :race_condition_ttl
13
+
14
+ def initialize(adapter, cache, ttl = nil, expires_in: :none_provided, race_condition_ttl: nil, write_through: false, prefix: nil)
11
15
  if expires_in == :none_provided
12
16
  ttl ||= nil
13
17
  else
@@ -18,6 +22,7 @@ module Flipper
18
22
  ttl = expires_in
19
23
  end
20
24
  super(adapter, cache, ttl, prefix: prefix)
25
+ @race_condition_ttl = race_condition_ttl
21
26
  @write_through = write_through
22
27
  end
23
28
 
@@ -73,6 +78,7 @@ module Flipper
73
78
  def write_options
74
79
  write_options = {}
75
80
  write_options[:expires_in] = @ttl if @ttl
81
+ write_options[:race_condition_ttl] if @race_condition_ttl
76
82
  write_options
77
83
  end
78
84
  end
@@ -1,5 +1,5 @@
1
1
  module Flipper
2
- VERSION = '1.3.4'.freeze
2
+ VERSION = '1.3.6'.freeze
3
3
 
4
4
  REQUIRED_RUBY_VERSION = '2.6'.freeze
5
5
  NEXT_REQUIRED_RUBY_VERSION = '3.0'.freeze
@@ -8,7 +8,8 @@ RSpec.describe Flipper::Adapters::ActiveSupportCacheStore do
8
8
  end
9
9
  let(:cache) { ActiveSupport::Cache::MemoryStore.new }
10
10
  let(:write_through) { false }
11
- let(:adapter) { described_class.new(memory_adapter, cache, 10, write_through: write_through) }
11
+ let(:race_condition_ttl) { 5 }
12
+ let(:adapter) { described_class.new(memory_adapter, cache, 10, race_condition_ttl: race_condition_ttl, write_through: write_through) }
12
13
  let(:flipper) { Flipper.new(adapter) }
13
14
 
14
15
  subject { adapter }
@@ -42,6 +43,15 @@ RSpec.describe Flipper::Adapters::ActiveSupportCacheStore do
42
43
  expect(adapter.ttl).to be(nil)
43
44
  end
44
45
 
46
+ it "knows race_condition_ttl" do
47
+ expect(adapter.race_condition_ttl).to eq(race_condition_ttl)
48
+ end
49
+
50
+ it "knows default when no ttl or expires_in provided" do
51
+ adapter = described_class.new(memory_adapter, cache)
52
+ expect(adapter.race_condition_ttl).to be(nil)
53
+ end
54
+
45
55
  it "knows features_cache_key" do
46
56
  expect(adapter.features_cache_key).to eq("flipper/v1/features")
47
57
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flipper-active_support_cache_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-03 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: flipper
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 1.3.4
18
+ version: 1.3.6
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: 1.3.4
25
+ version: 1.3.6
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: activesupport
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -61,7 +61,7 @@ metadata:
61
61
  homepage_uri: https://www.flippercloud.io
62
62
  source_code_uri: https://github.com/flippercloud/flipper
63
63
  bug_tracker_uri: https://github.com/flippercloud/flipper/issues
64
- changelog_uri: https://github.com/flippercloud/flipper/releases/tag/v1.3.4
64
+ changelog_uri: https://github.com/flippercloud/flipper/releases/tag/v1.3.6
65
65
  funding_uri: https://github.com/sponsors/flippercloud
66
66
  rdoc_options: []
67
67
  require_paths:
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  - !ruby/object:Gem::Version
78
78
  version: '0'
79
79
  requirements: []
80
- rubygems_version: 3.6.5
80
+ rubygems_version: 3.6.9
81
81
  specification_version: 4
82
82
  summary: ActiveSupport::Cache feature flag cache adapter for Flipper
83
83
  test_files: