@obisey/nest 0.1.31 → 0.1.32
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.
package/package.json
CHANGED
|
@@ -496,7 +496,7 @@ function BaseResolver(modelo) {
|
|
|
496
496
|
let ids = await this.redis.hGet(nkey, planeta);
|
|
497
497
|
if (ids) {
|
|
498
498
|
Promise.all(JSON.parse(ids).map((id) => this.redis.hExists(pkey(id), 'item'))).then((exists) => {
|
|
499
|
-
if (!exists.includes(
|
|
499
|
+
if (!exists.includes(false)) {
|
|
500
500
|
Promise.all(JSON.parse(ids).map(async (id) => await this.redis.hGet(pkey(id), 'item'))).then(resolve);
|
|
501
501
|
}
|
|
502
502
|
else
|
|
@@ -202,8 +202,8 @@ function BaseService(modelo) {
|
|
|
202
202
|
console.log(`[OBSERVAR-EXISTS-${idx}] ${modelo}: id=${id}, hExists(pkey(id), 'item')=${exists}`);
|
|
203
203
|
return exists;
|
|
204
204
|
})).then((exists) => {
|
|
205
|
-
console.log(`[OBSERVAR-EXISTS-ARRAY] ${modelo}: all checks done, exists=[${exists}], includes(
|
|
206
|
-
if (!exists.includes(
|
|
205
|
+
console.log(`[OBSERVAR-EXISTS-ARRAY] ${modelo}: all checks done, exists=[${exists}], includes(false)=${exists.includes(false)}`);
|
|
206
|
+
if (!exists.includes(false)) {
|
|
207
207
|
console.log(`[OBSERVAR-ALL-EXIST] ${modelo}: all items exist, fetching from Redis`);
|
|
208
208
|
Promise.all(idArray.map(async (id, idx) => {
|
|
209
209
|
const item = await this.redis.hGet(pkey(id), 'item');
|
|
@@ -217,7 +217,7 @@ function BaseService(modelo) {
|
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
219
|
else {
|
|
220
|
-
console.log(`[OBSERVAR-INCOMPLETE] ${modelo}: some items missing. exists.includes(
|
|
220
|
+
console.log(`[OBSERVAR-INCOMPLETE] ${modelo}: some items missing. exists.includes(false)=true, fallback to DB`);
|
|
221
221
|
resolve(undefined);
|
|
222
222
|
}
|
|
223
223
|
});
|