dobi-cache-2
Advanced tools
Comparing version 3.0.8 to 3.0.9
@@ -55,3 +55,3 @@ /* eslint-disable no-process-env */ | ||
async getKeys() { | ||
async getKeys(pattern = '*') { | ||
if (this.isDisabled()) { | ||
@@ -63,3 +63,3 @@ return []; | ||
if (this.method === 'redis') { | ||
keys = await this.redis.keys(`${this.keyPrefix}:*`); | ||
keys = await this.redis.keys(`${this.keyPrefix}:${pattern}`); | ||
} else { | ||
@@ -73,7 +73,7 @@ keys = this.lru.keys(); | ||
async flushCache() { | ||
async flushCache(pattern) { | ||
if (this.isDisabled()) { | ||
return 0; | ||
} | ||
const keys = await this.getKeys(); | ||
const keys = await this.getKeys(pattern); | ||
const flushed = []; | ||
@@ -80,0 +80,0 @@ const promises = keys.map(async (key) => { |
@@ -28,3 +28,3 @@ { | ||
}, | ||
"version": "3.0.8", | ||
"version": "3.0.9", | ||
"devDependencies": { | ||
@@ -31,0 +31,0 @@ "eslint": "^5.5.0", |
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
23955