kasket 4.9.0 → 4.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kasket/read_mixin.rb +17 -5
- data/lib/kasket/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75e9005963ca629245005b0c9a2a9d94cb9023fac9cc12327045e25eaca547e0
|
4
|
+
data.tar.gz: e7aec95609b6918646f3b2b420d5af038ef171888ac98cdea4c0fb16cf6ce086
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f19bd6ca3a60073c738907e20052d461cdcc0139a1c300765ed3b029022107d7c477b6a5e6437bb34d73de5d8e2c6050eac3e6834ec6c7f27c3e7e1e5a0fa200
|
7
|
+
data.tar.gz: effe82d0f1620cc7742407a46054b558675ac061050af22313daccdc52dc30204c5ae02c67f91aeea64ce07f4c687d2a6eb699c132a0914284d2554cec0d014b
|
data/lib/kasket/read_mixin.rb
CHANGED
@@ -64,11 +64,23 @@ module Kasket
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def find_by_sql_with_kasket_on_id_array(keys)
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
67
|
+
begin
|
68
|
+
key_attributes_map = Kasket.cache.read_multi(*keys)
|
69
|
+
rescue RuntimeError => e
|
70
|
+
# Elasticache Memcached has a bug where it returns a 0x00 binary protocol response with no data
|
71
|
+
# during a reboot, causing the Dalli memcached client to throw a RuntimeError during a multi get
|
72
|
+
# (https://github.com/petergoldstein/dalli/blob/v2.7.7/lib/dalli/server.rb#L148).
|
73
|
+
# Fall back to the database when this happens.
|
74
|
+
if e.message == "multi_response has completed"
|
75
|
+
key_attributes_map = missing_records_from_db(keys)
|
76
|
+
else
|
77
|
+
raise
|
78
|
+
end
|
79
|
+
else
|
80
|
+
found_keys, missing_keys = keys.partition {|k| key_attributes_map[k] }
|
81
|
+
found_keys.each {|k| key_attributes_map[k] = instantiate(key_attributes_map[k].dup) }
|
82
|
+
key_attributes_map.merge!(missing_records_from_db(missing_keys))
|
83
|
+
end
|
72
84
|
|
73
85
|
key_attributes_map.values.compact
|
74
86
|
end
|
data/lib/kasket/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kasket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.9.
|
4
|
+
version: 4.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mick Staugaard
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-08-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
180
|
- !ruby/object:Gem::Version
|
181
181
|
version: '0'
|
182
182
|
requirements: []
|
183
|
-
rubygems_version: 3.
|
183
|
+
rubygems_version: 3.1.6
|
184
184
|
signing_key:
|
185
185
|
specification_version: 4
|
186
186
|
summary: A write back caching layer on active record
|