evt-entity_cache 0.16.0.1 → 0.16.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/entity_cache/entity_cache.rb +8 -8
- data/lib/entity_cache/log.rb +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e558e0a49528e4c6782134259c0b38cbd1af60d8421687ef6ce206b4e0e773b
|
4
|
+
data.tar.gz: 9e46dcdc98b9f84e0e3f5e1d38e913d7b4aef730d3f2a0174c5432befcd87616
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f88fea27ac26be198f38d4b79e4d28c472210c45714cebe90985218434cf35f29310c86ef733072343c1a6ff99193c2aa401dfb1adc1850709a301d08c45b8e
|
7
|
+
data.tar.gz: 3cc2d4dd954060ab36e5e114c071957cf405e5ed0356033042f35a33aa08c8a0e0806c77a9e5180569078d44506ba1a973d6845b07ed52b713581f7a5538c67a
|
@@ -41,7 +41,7 @@ class EntityCache
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def get(id)
|
44
|
-
logger.trace { "Get entity (ID: #{id.inspect})" }
|
44
|
+
logger.trace(tag: :cache) { "Get entity (ID: #{id.inspect})" }
|
45
45
|
|
46
46
|
record = internal_store.get(id)
|
47
47
|
|
@@ -50,9 +50,9 @@ class EntityCache
|
|
50
50
|
end
|
51
51
|
|
52
52
|
if record.nil?
|
53
|
-
logger.info { "
|
53
|
+
logger.info(tag: :cache) { "Cache miss getting entity (ID: #{id.inspect}, #{Record::LogText.get(record)})" }
|
54
54
|
else
|
55
|
-
logger.info { "Get entity done (ID: #{id.inspect}, #{Record::LogText.get(record)})" }
|
55
|
+
logger.info(tag: :cache) { "Get entity done (ID: #{id.inspect}, #{Record::LogText.get(record)})" }
|
56
56
|
end
|
57
57
|
|
58
58
|
record
|
@@ -65,7 +65,7 @@ class EntityCache
|
|
65
65
|
|
66
66
|
record = Record.build(id, entity, version, time)
|
67
67
|
|
68
|
-
logger.trace { "Put entity (ID: #{id.inspect}, #{Record::LogText.get(record)}, Persist Interval: #{persist_interval.inspect})" }
|
68
|
+
logger.trace(tag: :cache) { "Put entity (ID: #{id.inspect}, #{Record::LogText.get(record)}, Persist Interval: #{persist_interval.inspect})" }
|
69
69
|
|
70
70
|
if persist?(version, persisted_version)
|
71
71
|
external_store.put(id, entity, version, time)
|
@@ -80,18 +80,18 @@ class EntityCache
|
|
80
80
|
|
81
81
|
internal_store.put(record)
|
82
82
|
|
83
|
-
logger.info { "Put entity done (ID: #{id.inspect}, #{Record::LogText.get(record)}, Persist Interval: #{persist_interval.inspect}, Updated External Store: #{updated_external_store})" }
|
83
|
+
logger.info(tag: :cache) { "Put entity done (ID: #{id.inspect}, #{Record::LogText.get(record)}, Persist Interval: #{persist_interval.inspect}, Updated External Store: #{updated_external_store})" }
|
84
84
|
|
85
85
|
record
|
86
86
|
end
|
87
87
|
|
88
88
|
def restore(id)
|
89
|
-
logger.trace { "Restoring entity (ID: #{id.inspect})" }
|
89
|
+
logger.trace(tag: :cache) { "Restoring entity (ID: #{id.inspect})" }
|
90
90
|
|
91
91
|
entity, version, time = external_store.get(id)
|
92
92
|
|
93
93
|
if entity.nil?
|
94
|
-
logger.debug { "Could not restore entity (ID: #{id.inspect})" }
|
94
|
+
logger.debug(tag: :cache) { "Could not restore entity. No entity record. (ID: #{id.inspect})" }
|
95
95
|
|
96
96
|
return nil
|
97
97
|
end
|
@@ -107,7 +107,7 @@ class EntityCache
|
|
107
107
|
|
108
108
|
internal_store.put(record)
|
109
109
|
|
110
|
-
logger.debug { "Restored entity (ID: #{id.inspect}, #{Record::LogText.get(record)})" }
|
110
|
+
logger.debug(tag: :cache) { "Restored entity (ID: #{id.inspect}, #{Record::LogText.get(record)})" }
|
111
111
|
|
112
112
|
record
|
113
113
|
end
|
data/lib/entity_cache/log.rb
CHANGED