activesupport_cache_database 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57713e86691e63aafba7d0a6058f46add905cd0087dfe8e1b10213171903c246
4
- data.tar.gz: ef982713ee31115a33e51d493e83df54b2a949142f023e4fcacf7d8cc8435db4
3
+ metadata.gz: '0840ceacca7159f5b4abd0ac006342cac7852ee2bcd8b993c81d43393ec2579e'
4
+ data.tar.gz: e25a5fde4bb9c870ef23df5f5ba8215f68504b366ddac2ea5cdab2dacddcba1c
5
5
  SHA512:
6
- metadata.gz: 2a9e2192dd884334ec69ee1fcd418193c8a2499156dc553f18d9c7a6ea3d92fc6862f33a4d391eacc10ce4ae598aec4148a154f22b12f02018a00a2408a9aaef
7
- data.tar.gz: e28a4b456bc68804bbb247a6dfc3159bdaf2ea31a1ba67685c6dcf1e1d012d948029b6de23821015d38ca49d6e15ad0144e0912a159bc66db29c3aa01d0ec6fa
6
+ metadata.gz: 718e24bd6dc5c98cd7c5694c8dc92a759725b53dede1076c5d6079d2ce956676f68b0fa0e20f9f17176d4a11162922185b1feded4073b34cf09b87804628a058
7
+ data.tar.gz: 1b463a7fa6e6c297f5a2c68cf16bde3565b33e9a6e03922a3109d8bf329aaa1b08046b509954ee56bce7c072f54101f7abeaca7fb90f51c506411680b297795d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activesupport_cache_database (0.3.1)
4
+ activesupport_cache_database (0.3.2)
5
5
  activerecord (>= 6.0)
6
6
  activesupport (>= 6.0)
7
7
 
@@ -19,7 +19,7 @@ GEM
19
19
  minitest (>= 5.1)
20
20
  tzinfo (~> 2.0)
21
21
  ast (2.4.2)
22
- concurrent-ruby (1.2.0)
22
+ concurrent-ruby (1.2.2)
23
23
  diff-lcs (1.5.0)
24
24
  i18n (1.12.0)
25
25
  concurrent-ruby (~> 1.0)
@@ -28,18 +28,18 @@ GEM
28
28
  minitest (5.17.0)
29
29
  mysql2 (0.5.5)
30
30
  parallel (1.22.1)
31
- parser (3.2.0.0)
31
+ parser (3.2.1.0)
32
32
  ast (~> 2.4.1)
33
- pg (1.4.5)
33
+ pg (1.4.6)
34
34
  rainbow (3.1.1)
35
35
  rake (13.0.6)
36
- regexp_parser (2.6.2)
36
+ regexp_parser (2.7.0)
37
37
  rexml (3.2.5)
38
38
  rspec (3.12.0)
39
39
  rspec-core (~> 3.12.0)
40
40
  rspec-expectations (~> 3.12.0)
41
41
  rspec-mocks (~> 3.12.0)
42
- rspec-core (3.12.0)
42
+ rspec-core (3.12.1)
43
43
  rspec-support (~> 3.12.0)
44
44
  rspec-expectations (3.12.2)
45
45
  diff-lcs (>= 1.2.0, < 2.0)
@@ -48,26 +48,26 @@ GEM
48
48
  diff-lcs (>= 1.2.0, < 2.0)
49
49
  rspec-support (~> 3.12.0)
50
50
  rspec-support (3.12.0)
51
- rubocop (1.44.1)
51
+ rubocop (1.47.0)
52
52
  json (~> 2.3)
53
53
  parallel (~> 1.10)
54
54
  parser (>= 3.2.0.0)
55
55
  rainbow (>= 2.2.2, < 4.0)
56
56
  regexp_parser (>= 1.8, < 3.0)
57
57
  rexml (>= 3.2.5, < 4.0)
58
- rubocop-ast (>= 1.24.1, < 2.0)
58
+ rubocop-ast (>= 1.26.0, < 2.0)
59
59
  ruby-progressbar (~> 1.7)
60
60
  unicode-display_width (>= 2.4.0, < 3.0)
61
- rubocop-ast (1.24.1)
62
- parser (>= 3.1.1.0)
61
+ rubocop-ast (1.27.0)
62
+ parser (>= 3.2.1.0)
63
63
  rubocop-bsm (0.6.1)
64
64
  rubocop (~> 1.0)
65
65
  rubocop-performance
66
66
  rubocop-rake
67
67
  rubocop-rspec
68
- rubocop-capybara (2.17.0)
68
+ rubocop-capybara (2.17.1)
69
69
  rubocop (~> 1.41)
70
- rubocop-performance (1.15.2)
70
+ rubocop-performance (1.16.0)
71
71
  rubocop (>= 1.7.0, < 2.0)
72
72
  rubocop-ast (>= 0.4.0)
73
73
  rubocop-rake (0.6.0)
@@ -76,7 +76,7 @@ GEM
76
76
  rubocop (~> 1.33)
77
77
  rubocop-capybara (~> 2.17)
78
78
  ruby-progressbar (1.11.0)
79
- sqlite3 (1.6.0)
79
+ sqlite3 (1.6.1)
80
80
  mini_portile2 (~> 2.8.0)
81
81
  tzinfo (2.0.6)
82
82
  concurrent-ruby (~> 1.0)
@@ -87,7 +87,6 @@ PLATFORMS
87
87
 
88
88
  DEPENDENCIES
89
89
  activesupport_cache_database!
90
- bundler
91
90
  mysql2
92
91
  pg
93
92
  rake
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'activesupport_cache_database'
3
- s.version = '0.3.1'
3
+ s.version = '0.3.2'
4
4
  s.authors = ['Black Square Media Ltd']
5
5
  s.email = ['info@blacksquaremedia.com']
6
6
  s.summary = %(ActiveSupport::Cache::Store implementation backed by ActiveRecord.)
@@ -15,6 +15,5 @@ Gem::Specification.new do |s|
15
15
  s.add_dependency 'activerecord', '>= 6.0'
16
16
  s.add_dependency 'activesupport', '>= 6.0'
17
17
 
18
- s.add_development_dependency 'bundler'
19
18
  s.metadata['rubygems_mfa_required'] = 'true'
20
19
  end
@@ -74,6 +74,13 @@ module ActiveSupport
74
74
  record = @model.where(key: key).first_or_initialize
75
75
  expires_at = Time.zone.at(entry.expires_at) if entry.expires_at
76
76
  record.update! value: Marshal.dump(entry.value), version: entry.version.presence, expires_at: expires_at
77
+ rescue ActiveRecord::RecordNotUnique
78
+ # If two servers initialize a new record with the same cache key and try to save it,
79
+ # the saves will race. We do not need to ensure a specific save wins, but we do need to ensure
80
+ # that at least one of the saves succeeds and that none of the saves raise an exception.
81
+ # In practive it means that if there alread was a save that "won" from us and completed earlier
82
+ # we don't need to do anything.
83
+ true
77
84
  end
78
85
 
79
86
  def delete_entry(key, _options = nil)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activesupport_cache_database
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Black Square Media Ltd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-31 00:00:00.000000000 Z
11
+ date: 2023-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '6.0'
41
- - !ruby/object:Gem::Dependency
42
- name: bundler
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
41
  description: Use your DB as a cache store
56
42
  email:
57
43
  - info@blacksquaremedia.com
@@ -95,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
81
  - !ruby/object:Gem::Version
96
82
  version: '0'
97
83
  requirements: []
98
- rubygems_version: 3.3.3
84
+ rubygems_version: 3.4.6
99
85
  signing_key:
100
86
  specification_version: 4
101
87
  summary: ActiveSupport::Cache::Store implementation backed by ActiveRecord.