@quantos/micro-request
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -29,2 +29,3 @@ "use strict"; | ||
if (cached) { | ||
console.log('[@quantos/micro-request][Cache] ' + _url + ' retrieved from cache'); | ||
return cached; | ||
@@ -55,2 +56,3 @@ } | ||
if (_cached && _cached.length) { | ||
console.log('[@quantos/micro-request][Cache] ' + _url + ' retrieved ' + _cached.length + ' elements from cache'); | ||
results.push(..._cached); | ||
@@ -88,2 +90,3 @@ options.ids = options.ids.filter((id) => _cached.map((u) => u.id).indexOf(id) < 0); | ||
if (cached) { | ||
console.log('[@quantos/micro-request][Cache] retrieved ' + _url); | ||
return cached; | ||
@@ -90,0 +93,0 @@ } |
{ | ||
"name": "@quantos/micro-request", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Quantos http client with cache, retry and fallback mechanism", | ||
@@ -5,0 +5,0 @@ "author": "fabriziotognetto <info@quantos.it>", |
@@ -29,3 +29,6 @@ import { fallbackErrorHandler } from './fallback_error_handler'; | ||
const cached = await RedisCache.get<T>(`${options.id}`, _cachePrefix); | ||
if (cached) { return cached; } | ||
if (cached) { | ||
console.log('[@quantos/micro-request][Cache] ' + _url + ' retrieved from cache'); | ||
return cached; | ||
} | ||
} | ||
@@ -61,2 +64,3 @@ | ||
if (_cached && _cached.length) { | ||
console.log('[@quantos/micro-request][Cache] ' + _url + ' retrieved ' + _cached.length + ' elements from cache'); | ||
results.push(..._cached); | ||
@@ -102,3 +106,6 @@ // rimuovo dagli id quelli cachati | ||
const cached = await RedisCache.get(_url, _cachePrefix); | ||
if (cached) { return cached; } | ||
if (cached) { | ||
console.log('[@quantos/micro-request][Cache] retrieved ' + _url); | ||
return cached; | ||
} | ||
} | ||
@@ -105,0 +112,0 @@ |
Sorry, the diff of this file is not supported yet
37330
759