fix: cache key collision

v1.18.x
Barış Soner Uşaklı 4 years ago committed by GitHub
parent 8a2fe3d916
commit e40af441c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -243,14 +243,15 @@ Categories.getChildrenCids = async function (rootCid) {
await recursive(keys);
}
const key = 'cid:' + rootCid + ':children';
const childrenCids = cache.get(key);
const cacheKey = 'cache:' + key;
const childrenCids = cache.get(cacheKey);
if (childrenCids) {
return childrenCids.slice();
}
await recursive(key);
allCids = _.uniq(allCids);
cache.set(key, allCids);
cache.set(cacheKey, allCids);
return allCids.slice();
};

Loading…
Cancel
Save