Skip to content

Commit 1fe3f2d

Browse files
authored
chore(gatsby-source-contentful): cache the cache key (#28444)
1 parent 1853f3b commit 1fe3f2d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/gatsby-transformer-remark/src/extend-node-type.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,15 +364,16 @@ module.exports = function remarkExtendNodeType(
364364
}
365365

366366
async function getHTMLAst(markdownNode) {
367-
const cachedAst = await cache.get(htmlAstCacheKey(markdownNode))
367+
const key = htmlAstCacheKey(markdownNode)
368+
const cachedAst = await cache.get(key)
368369
if (cachedAst) {
369370
return cachedAst
370371
} else {
371372
const ast = await getAST(markdownNode, cache)
372373
const htmlAst = markdownASTToHTMLAst(ast)
373374

374375
// Save new HTML AST to cache and return
375-
await cache.set(htmlAstCacheKey(markdownNode), htmlAst)
376+
await cache.set(key, htmlAst)
376377
return htmlAst
377378
}
378379
}

0 commit comments

Comments
 (0)