mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-19 14:02:58 +01:00
test: fix redis tests
This commit is contained in:
@@ -98,9 +98,7 @@ module.exports = function (module) {
|
|||||||
if (!Array.isArray(keys) || !keys.length) {
|
if (!Array.isArray(keys) || !keys.length) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
if (!Array.isArray(fields)) {
|
|
||||||
return keys.map(() => ({}));
|
|
||||||
}
|
|
||||||
const cachedData = {};
|
const cachedData = {};
|
||||||
const unCachedKeys = cache.getUnCachedKeys(keys, cachedData);
|
const unCachedKeys = cache.getUnCachedKeys(keys, cachedData);
|
||||||
|
|
||||||
@@ -118,7 +116,7 @@ module.exports = function (module) {
|
|||||||
cache.set(key, cachedData[key]);
|
cache.set(key, cachedData[key]);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!fields.length) {
|
if (!Array.isArray(fields) || !fields.length) {
|
||||||
return keys.map(key => (cachedData[key] ? { ...cachedData[key] } : null));
|
return keys.map(key => (cachedData[key] ? { ...cachedData[key] } : null));
|
||||||
}
|
}
|
||||||
return keys.map((key) => {
|
return keys.map((key) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user