mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Added a reset method to the redis cache adapter
This allows us to reset cache rather than having to wait for the TTL period.
This commit is contained in:
parent
a50ef81148
commit
b84ed78078
1 changed files with 7 additions and 3 deletions
|
@ -140,10 +140,14 @@ class AdapterCacheRedis extends BaseCacheAdapter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reset the cache by deleting everything from redis
|
||||||
|
*/
|
||||||
async reset() {
|
async reset() {
|
||||||
// NOTE: dangerous in shared environment, and not used in production code anyway!
|
const keys = await this.#getKeys();
|
||||||
// return await this.cache.reset();
|
for (const key of keys) {
|
||||||
logging.error('Cache reset has not been implemented with shared cache environment in mind');
|
await this.cache.del(key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue