@obisey/nest 0.1.25 → 0.1.26
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
|
@@ -205,12 +205,15 @@ function BaseService(modelo) {
|
|
|
205
205
|
const idsToSave = resultado.map((n) => (0, getModelId_1.getModelId)(n));
|
|
206
206
|
console.log(`[ACTUALIZAR-IDS] ${modelo}: IDs=[${idsToSave}]`);
|
|
207
207
|
// SAVE INDIVIDUAL ITEMS
|
|
208
|
-
|
|
208
|
+
console.log(`[ACTUALIZAR-SAVING-ITEMS] ${modelo}: about to save ${resultado.length} items`);
|
|
209
|
+
const promises = resultado.map((item, idx) => {
|
|
209
210
|
const id = (0, getModelId_1.getModelId)(item);
|
|
210
211
|
const plainData = item.get({ plain: true });
|
|
212
|
+
console.log(`[ACTUALIZAR-ITEM-${id}] ${modelo}: saving to pkey=${pkey(id).substring(0, 40)}`);
|
|
211
213
|
return this.redis.hSet(pkey(id), 'item', JSON.stringify(plainData));
|
|
212
214
|
});
|
|
213
215
|
return Promise.all(promises).then(() => {
|
|
216
|
+
console.log(`[ACTUALIZAR-ALL-SAVED] ${modelo}: items saved, saving IDs`);
|
|
214
217
|
return this.redis.hSet(nkey, peticion, JSON.stringify(idsToSave));
|
|
215
218
|
});
|
|
216
219
|
});
|