From e40af441c9662ade1936476317757e6a5b5d279f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 5 Feb 2021 16:29:56 -0500 Subject: [PATCH] fix: cache key collision --- src/categories/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/categories/index.js b/src/categories/index.js index 4f74c6b6d1..de3f329544 100644 --- a/src/categories/index.js +++ b/src/categories/index.js @@ -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(); };