Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (this.__del(key)) this.log.debug('Removed key %s from memcache.', key);
else this.log.debug('Failed to remove key %s from memcache.', key);
// Also remove file if applicable
try {
fs.unlinkSync(path.join(this.cacheDir, key));
} catch (e) {
this.log.debug('No file cache with key %s', key);
}
};
};
/*
* Stores the old get method.
*/
Cache.prototype.__get = NodeCache.prototype.get;
/*
* Stores the old set method.
*/
Cache.prototype.__set = NodeCache.prototype.set;
/*
* Stores the old del method.
*/
Cache.prototype.__del = NodeCache.prototype.del;
/*
* Return the class
*/
module.exports = Cache;
fs.unlinkSync(path.join(this.cacheDir, key));
} catch (e) {
this.log.debug('No file cache with key %s', key);
}
};
};
/*
* Stores the old get method.
*/
Cache.prototype.__get = NodeCache.prototype.get;
/*
* Stores the old set method.
*/
Cache.prototype.__set = NodeCache.prototype.set;
/*
* Stores the old del method.
*/
Cache.prototype.__del = NodeCache.prototype.del;
/*
* Return the class
*/
module.exports = Cache;