New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

core.io-cache-redis

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

core.io-cache-redis - npm Package Compare versions

Comparing version 0.3.0 to 0.3.2

12

lib/cache.js

@@ -63,11 +63,18 @@ 'use strict';

* @param {Boolean} [addTimestamp=true] Include a timestamp to payload
* @param {Boolean} [throwOnError=false] Throw if fallback errors
* @returns {Promise}
*/
async tryGet(key, fallback, ttl = this.defaultTtl, serialize = true, addTimestamp = true) {
async tryGet(key, fallback, ttl = this.defaultTtl, serialize = true, addTimestamp = true, throwOnError = false) {
key = this.hashKey(key);
this.logger.info('try to fetch key "%s" from cache...', key);
let value = await this.get(key, false, serialize);
if (value) return value;
if (value) {
this.logger.info('value was cached, return');
return value;
}
try {

@@ -87,2 +94,3 @@ value = await fallback();

this.handleError(error, 'cache try error');
if (throwOnError) throw error;
}

@@ -89,0 +97,0 @@

@@ -8,2 +8,3 @@ 'use strict';

const Redis = require('ioredis');
return new Redis(url);

@@ -10,0 +11,0 @@ }

2

package.json
{
"name": "core.io-cache-redis",
"version": "0.3.0",
"version": "0.3.2",
"description": "Redis cache module",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc