identity_cache 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/identity_cache/cache_fetcher.rb +7 -3
- data/lib/identity_cache/fallback_fetcher.rb +5 -1
- data/lib/identity_cache/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: 25effde8c6f5f470a9e90f18a17b89ed2c12f4d3191e0c05110568acdcb2153c
|
4
|
+
data.tar.gz: ff299911448670f58000ca5f047d4a9bbd04fe00452392eb698232a40d244e74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b861f668ca23a245b16c6ac4d3a8a2b80d954386f67607bca8ce51507d7c3fcb8852d419e38e4c15f5999c8614fb7a5e2661d78687ea510b73f83d107a58c9e
|
7
|
+
data.tar.gz: dd2a1b9fa974aa139eb99b6e2bc718ee7725b15f54998a125bea2b552b4dfe7de537d9c216516ffb0419daecb40c762debff1c17fcbf973eb42b0344af7bb2ad
|
data/CHANGELOG.md
CHANGED
@@ -65,9 +65,13 @@ module IdentityCache
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def fetch_multi(keys, &block)
|
68
|
-
|
69
|
-
|
70
|
-
|
68
|
+
if IdentityCache.should_use_cache?
|
69
|
+
results = cas_multi(keys, &block)
|
70
|
+
results = add_multi(keys, &block) if results.nil?
|
71
|
+
results
|
72
|
+
else
|
73
|
+
{}
|
74
|
+
end
|
71
75
|
end
|
72
76
|
|
73
77
|
def fetch(key, fill_lock_duration: nil, lock_wait_tries: 2, &block)
|
@@ -21,7 +21,11 @@ module IdentityCache
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def fetch_multi(keys)
|
24
|
-
results =
|
24
|
+
results = if IdentityCache.should_use_cache?
|
25
|
+
@cache_backend.read_multi(*keys)
|
26
|
+
else
|
27
|
+
{}
|
28
|
+
end
|
25
29
|
missed_keys = keys - results.keys
|
26
30
|
unless missed_keys.empty?
|
27
31
|
replacement_results = yield missed_keys
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: identity_cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Camilo Lopez
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date: 2023-12-
|
17
|
+
date: 2023-12-15 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: activerecord
|
@@ -190,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
190
|
- !ruby/object:Gem::Version
|
191
191
|
version: '0'
|
192
192
|
requirements: []
|
193
|
-
rubygems_version: 3.4.
|
193
|
+
rubygems_version: 3.4.22
|
194
194
|
signing_key:
|
195
195
|
specification_version: 4
|
196
196
|
summary: IdentityCache lets you specify how you want to cache your model objects,
|