core.io-cache-redis
Advanced tools
Comparing version 0.10.0 to 0.11.0
@@ -73,2 +73,10 @@ const extend = require('gextend'); | ||
/** | ||
* If all keys were found in | ||
* the cache. Return values... | ||
*/ | ||
if (notEmpty(cachedValues) === rawKeys.length) { | ||
return cachedValues; | ||
} | ||
let values = [], | ||
@@ -103,10 +111,2 @@ batchKeys = [], | ||
/** | ||
* Great! All keys were found in | ||
* the cache. Return values... | ||
*/ | ||
if (values.length === rawKeys.length) { | ||
return values; | ||
} | ||
try { | ||
@@ -138,2 +138,3 @@ /** | ||
const setValues = []; | ||
for (const i in batchValues) { | ||
@@ -159,7 +160,10 @@ let value = batchValues[i]; | ||
*/ | ||
values[index] = value; | ||
if (index) { | ||
values[index] = value; | ||
setValues.push(value); | ||
} | ||
} | ||
try { | ||
await this.setBatch(batchKeys, values, options); | ||
await this.setBatch(batchKeys, setValues, options); | ||
} catch (error) { | ||
@@ -274,2 +278,7 @@ values = { $error: error }; | ||
return false; | ||
} | ||
function notEmpty(a = []) { | ||
return a.filter(a => a != null).length; | ||
} |
{ | ||
"name": "core.io-cache-redis", | ||
"version": "0.10.0", | ||
"version": "0.11.0", | ||
"description": "Redis cache module", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30739
742