mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
refactor: dont del if cache disabled
This commit is contained in:
3
src/cache/lru.js
vendored
3
src/cache/lru.js
vendored
@@ -95,6 +95,9 @@ module.exports = function (opts) {
|
||||
};
|
||||
|
||||
cache.del = function (keys) {
|
||||
if (!cache.enabled) {
|
||||
return;
|
||||
}
|
||||
if (!Array.isArray(keys)) {
|
||||
keys = [keys];
|
||||
}
|
||||
|
||||
3
src/cache/ttl.js
vendored
3
src/cache/ttl.js
vendored
@@ -70,6 +70,9 @@ module.exports = function (opts) {
|
||||
};
|
||||
|
||||
cache.del = function (keys) {
|
||||
if (!cache.enabled) {
|
||||
return;
|
||||
}
|
||||
if (!Array.isArray(keys)) {
|
||||
keys = [keys];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user