mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 07:07:13 +02:00
* feat: #8824, cache refactor ability to disable caches ability to download contents of cache refactor cache modules to remove duplicated code * fix: remove duplicate hit/miss tracking check cacheEnabled in getUncachedKeys
This commit is contained in:
committed by
GitHub
parent
bcbc085497
commit
f1f9b225b0
@@ -33,7 +33,7 @@ module.exports = function (module) {
|
||||
await module.client.async.hmset(key, data);
|
||||
}
|
||||
|
||||
cache.delObjectCache(key);
|
||||
cache.del(key);
|
||||
};
|
||||
|
||||
module.setObjectField = async function (key, field, value) {
|
||||
@@ -48,7 +48,7 @@ module.exports = function (module) {
|
||||
await module.client.async.hset(key, field, value);
|
||||
}
|
||||
|
||||
cache.delObjectCache(key);
|
||||
cache.del(key);
|
||||
};
|
||||
|
||||
module.getObject = async function (key) {
|
||||
@@ -146,7 +146,7 @@ module.exports = function (module) {
|
||||
return;
|
||||
}
|
||||
await module.client.async.hdel(key, field);
|
||||
cache.delObjectCache(key);
|
||||
cache.del(key);
|
||||
};
|
||||
|
||||
module.deleteObjectFields = async function (key, fields) {
|
||||
@@ -158,7 +158,7 @@ module.exports = function (module) {
|
||||
return;
|
||||
}
|
||||
await module.client.async.hdel(key, fields);
|
||||
cache.delObjectCache(key);
|
||||
cache.del(key);
|
||||
};
|
||||
|
||||
module.incrObjectField = async function (key, field) {
|
||||
@@ -182,7 +182,7 @@ module.exports = function (module) {
|
||||
} else {
|
||||
result = await module.client.async.hincrby(key, field, value);
|
||||
}
|
||||
cache.delObjectCache(key);
|
||||
cache.del(key);
|
||||
return Array.isArray(result) ? result.map(value => parseInt(value, 10)) : parseInt(result, 10);
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user