mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: cache key collision
This commit is contained in:
committed by
GitHub
parent
8a2fe3d916
commit
e40af441c9
@@ -243,14 +243,15 @@ Categories.getChildrenCids = async function (rootCid) {
|
|||||||
await recursive(keys);
|
await recursive(keys);
|
||||||
}
|
}
|
||||||
const key = 'cid:' + rootCid + ':children';
|
const key = 'cid:' + rootCid + ':children';
|
||||||
const childrenCids = cache.get(key);
|
const cacheKey = 'cache:' + key;
|
||||||
|
const childrenCids = cache.get(cacheKey);
|
||||||
if (childrenCids) {
|
if (childrenCids) {
|
||||||
return childrenCids.slice();
|
return childrenCids.slice();
|
||||||
}
|
}
|
||||||
|
|
||||||
await recursive(key);
|
await recursive(key);
|
||||||
allCids = _.uniq(allCids);
|
allCids = _.uniq(allCids);
|
||||||
cache.set(key, allCids);
|
cache.set(cacheKey, allCids);
|
||||||
return allCids.slice();
|
return allCids.slice();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user