unconventional 1.14.0 → 1.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -48,7 +48,7 @@ class AbstractBaseMiddleware {
|
|
|
48
48
|
if (!belongsToRelation)
|
|
49
49
|
return null;
|
|
50
50
|
const [relationKey, prop] = belongsToRelation;
|
|
51
|
-
const parentModel = (0, utils_1.getRelationModel)(prop.relation
|
|
51
|
+
const parentModel = (0, utils_1.getRelationModel)(prop.relation);
|
|
52
52
|
path.push(relationKey);
|
|
53
53
|
currentModel = parentModel;
|
|
54
54
|
}
|
|
@@ -14,7 +14,12 @@ async function getCachedOrFetch(cache, key, fetchFn, ttl = api_types_1.DefaultCa
|
|
|
14
14
|
const response = await fetchFn();
|
|
15
15
|
// Cache if successful
|
|
16
16
|
if (response && cache) {
|
|
17
|
-
|
|
17
|
+
try {
|
|
18
|
+
await cache.put(key, JSON.stringify(response), { expirationTtl: ttl });
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
// Suppress cache errors (e.g. rate limiting) so response is still returned
|
|
22
|
+
}
|
|
18
23
|
}
|
|
19
24
|
return response;
|
|
20
25
|
}
|