cache_utils 0.2.8 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cache_utils/model.rb +7 -2
- data/lib/cache_utils/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa3c8892bf510ff6f65dd92196f83750df8c355d
|
4
|
+
data.tar.gz: 38a46e60dddd74bd5aa49d987ddf7163de4a7e4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2a298bd8e45f35a50111327e55c4805c341ecd0a7aec5518703cabff9f52b2b3176be3438e39d789f39efba13b44775cdf5fd8d75ce51fc6a1fa8d360bd3d7d
|
7
|
+
data.tar.gz: 2469bd737d7ec389386ea4d3fdcdf9610577378e6bebd18f968deab535663f62d97b13955c43ed244fb6b685637ebaee491d4f214bcf7731d2e3b8b4fb0323c4
|
data/lib/cache_utils/model.rb
CHANGED
@@ -19,8 +19,13 @@ module CacheUtils
|
|
19
19
|
def purge_cache
|
20
20
|
class_keys = self.class.cache_key
|
21
21
|
class_keys += extra_class_key if respond_to?(:extra_class_key)
|
22
|
-
|
23
|
-
|
22
|
+
redisw = $redisw || $redis
|
23
|
+
redisr = $redisr || $redis
|
24
|
+
keys = (redisr.scan_each(match: custom_cache_key + '*').to_a + redisr.scan_each(match: class_keys + '*').to_a)
|
25
|
+
unless keys.empty?
|
26
|
+
redisw.del(*keys)
|
27
|
+
Appsignal.increment_counter('cache_purge', 1) if defined?(Appsignal)
|
28
|
+
end
|
24
29
|
end
|
25
30
|
end
|
26
31
|
end
|
data/lib/cache_utils/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cache_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michele Finotto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|