Skip to content

Commit cdcf136

Browse files
Fix redis-stack-custom example (caching-tools#175)
1 parent f6aa8d9 commit cdcf136

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.changeset/empty-lamps-marry.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'cache-handler-docs': patch
3+
---
4+
5+
Fix redis-stack-custom example

docs/cache-handler-docs/src/pages/redis-stack-custom.mdx

+3-4
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,17 @@ IncrementalCache.onCreation(async () => {
3535
await client.json.set(TAGS_MANIFEST_KEY, '.', localTagsManifest, {
3636
NX: true,
3737
});
38-
3938
return {
4039
cache: {
4140
async get(key) {
4241
try {
43-
const value = (await client.json.get(key)) ?? null;
42+
const cacheValue = (await client.json.get(key)) ?? null;
4443

4544
if (cacheValue && cacheValue.value?.kind === 'ROUTE' && cacheValue.value.body.type === 'Buffer') {
4645
cacheValue.value.body = Buffer.from(cacheValue.value.body);
4746
}
4847

49-
return value;
48+
return cacheValue;
5049
} catch (error) {
5150
return null;
5251
}
@@ -66,7 +65,7 @@ IncrementalCache.onCreation(async () => {
6665
localTagsManifest = sharedTagsManifest;
6766
}
6867

69-
return sharedTagsManifest;
68+
return localTagsManifest;
7069
} catch (error) {
7170
return localTagsManifest;
7271
}

0 commit comments

Comments
 (0)