cache-service-node-cache
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -18,3 +18,3 @@ var nodeCache = require('node-cache'); | ||
self.verbose = config.verbose || false; | ||
self.expiration = config.defaultExpiration || 900; | ||
self.defaultExpiration = config.defaultExpiration || 900; | ||
self.readOnly = (typeof config.readOnly === 'boolean') ? config.readOnly : false; | ||
@@ -36,3 +36,3 @@ self.checkOnPreviousEmpty = (typeof config.checkOnPreviousEmpty === 'boolean') ? config.checkOnPreviousEmpty : true; | ||
try { | ||
cacheKey = (cleanKey) ? cleanKey : key; | ||
var cacheKey = (cleanKey) ? cleanKey : key; | ||
log(false, 'Attempting to get key:', {key: cacheKey}); | ||
@@ -71,3 +71,3 @@ self.db.get(cacheKey, function(err, result){ | ||
if(!self.readOnly){ | ||
expiration = expiration || self.expiration; | ||
expiration = expiration || self.defaultExpiration; | ||
cb = cb || noop; | ||
@@ -91,3 +91,3 @@ self.db.set(key, value, expiration, cb); | ||
if(obj.hasOwnProperty(key)){ | ||
var tempExpiration = expiration || self.expiration; | ||
var tempExpiration = expiration || self.defaultExpiration; | ||
var value = obj[key]; | ||
@@ -127,3 +127,3 @@ if(typeof value === 'object' && value.cacheValue){ | ||
self.flushAll = function(cb){ | ||
log(false, 'Attempting to flush all data:'); | ||
log(false, 'Attempting to flush all data.'); | ||
try { | ||
@@ -153,3 +153,3 @@ self.db.flushAll(); | ||
} | ||
self.type = config.type || 'node-cache-standalone'; | ||
self.type = config.type || 'node-cache'; | ||
} | ||
@@ -164,3 +164,3 @@ | ||
function log(isError, message, data){ | ||
var indentifier = 'cacheService: '; | ||
var indentifier = 'nodeCacheModule: '; | ||
if(self.verbose || isError){ | ||
@@ -167,0 +167,0 @@ if(data) console.log(indentifier + message, data); |
{ | ||
"name": "cache-service-node-cache", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A node-cache plugin for cache-service.", | ||
@@ -5,0 +5,0 @@ "main": "nodeCacheModule.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
7956