@edjopato/datastore
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -54,8 +54,7 @@ "use strict"; | ||
} | ||
if (keysToBeLoaded.length === 0) { | ||
return {}; | ||
if (keysToBeLoaded.length > 0) { | ||
const queryResults = await this._bulkQuery(keysToBeLoaded); | ||
await Promise.all(Object.keys(queryResults) | ||
.map(async (key) => this._store.set(key, queryResults[key], this._ttl))); | ||
} | ||
const queryResults = await this._bulkQuery(keysToBeLoaded); | ||
await Promise.all(Object.keys(queryResults) | ||
.map(async (key) => this._store.set(key, queryResults[key], this._ttl))); | ||
const resultEntries = await Promise.all(keys | ||
@@ -62,0 +61,0 @@ .map(async (key) => { |
@@ -15,3 +15,2 @@ "use strict"; | ||
for (const [key, value] of map.entries()) { | ||
console.log('cleanup old', key, value.until); | ||
if (typeof value.until === 'number' && value.until < now) { | ||
@@ -18,0 +17,0 @@ toBeDeleted.push(key); |
{ | ||
"name": "@edjopato/datastore", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Handles different ways to store data within NodeJS", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
43928
677