mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: add .has() method in cache/ttl lib
This commit is contained in:
8
src/cache/ttl.js
vendored
8
src/cache/ttl.js
vendored
@@ -30,6 +30,14 @@ module.exports = function (opts) {
|
||||
});
|
||||
});
|
||||
|
||||
cache.has = (key) => {
|
||||
if (!cache.enabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return ttlCache.has(key);
|
||||
};
|
||||
|
||||
cache.set = function (key, value, ttl) {
|
||||
if (!cache.enabled) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user