artirix_data_models 0.30.0 → 0.31.0
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0da26214f0430c9250de8d6612d9f0f6b98ad49
|
4
|
+
data.tar.gz: 4dfcc8eaec6f4aaec45ef8a62fbb8c07efa52d7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 266689d66972416d55e64c828709b90f58a71b5daa22e0c99d1b7f1174b763280fa0ab30cecc9b0e047ab1b58ba0cf9af2e1a46e5ada169f712c33bfc124cbc4
|
7
|
+
data.tar.gz: 23a3285b7906014c27074f08f73936bfb9dc02e50d42482cdf41ea64d19a6546aafcfb2a81c646f98ecf8796ff6f6dfe4bbc1b7de422d7deea06b8b16bc12f24
|
data/README.md
CHANGED
@@ -327,6 +327,11 @@ end
|
|
327
327
|
|
328
328
|
## Changes
|
329
329
|
|
330
|
+
### 0.31.0
|
331
|
+
|
332
|
+
- `CacheAdaptor` has a `delete` method now, which calls `cache.delete cache_key`.
|
333
|
+
- Gateway tries to call `cache_adaptor.delete` if any exception is raised during a request (including parsing the response), before re-raising the exception.
|
334
|
+
|
330
335
|
### 0.30.0
|
331
336
|
|
332
337
|
- expose as config in connection the `faraday_adapter`. If falsey it will default to `Faraday.default_adapter`.
|
@@ -41,6 +41,11 @@ class ArtirixDataModels::CachedActionAdaptor
|
|
41
41
|
@enabled
|
42
42
|
end
|
43
43
|
|
44
|
+
def delete
|
45
|
+
return true unless enabled?
|
46
|
+
cache_delete
|
47
|
+
end
|
48
|
+
|
44
49
|
private
|
45
50
|
|
46
51
|
def get_cached_result
|
@@ -114,4 +119,11 @@ class ArtirixDataModels::CachedActionAdaptor
|
|
114
119
|
value
|
115
120
|
end
|
116
121
|
|
122
|
+
def cache_delete
|
123
|
+
logger.debug "DELETE CACHE with key #{cache_key.inspect}"
|
124
|
+
return true unless cache
|
125
|
+
|
126
|
+
cache.delete cache_key, cache_options
|
127
|
+
end
|
128
|
+
|
117
129
|
end
|
@@ -79,6 +79,14 @@ class ArtirixDataModels::DataGateway
|
|
79
79
|
response_adaptor: response_adaptor,
|
80
80
|
method: method,
|
81
81
|
path: path
|
82
|
+
rescue => e
|
83
|
+
# if anything goes wrong => delete the cache just in case.
|
84
|
+
|
85
|
+
if cache_adaptor.present? && cache_adaptor.respond_to?(:delete)
|
86
|
+
cache_adaptor.delete
|
87
|
+
end
|
88
|
+
|
89
|
+
raise e
|
82
90
|
end
|
83
91
|
|
84
92
|
private
|