Skip to content
This repository was archived by the owner on Nov 24, 2020. It is now read-only.

Commit ecf82f7

Browse files
fix: Declare decodedKey as a const
1 parent 8fb6056 commit ecf82f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/target/typescript_nodeserver.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ END
138138
@io << ident ident ident ident "const {key: cacheKey, expirationSeconds: cacheExpirationSeconds, version: cacheVersion} = await cacheConfig.#{op.pretty_name}(#{(["ctx"] + op.args.map(&.name)).join(", ")});\n"
139139
@io << ident ident ident ident "if (!key) throw \"\";\n"
140140
@io << ident ident ident ident "const cacheKeyEncoded = crypto.createHash(\"sha256\").update(JSON.stringify(cacheKey)+ \"-#{op.pretty_name}\").digest(\"hex\").substr(0, 100); decodedKey = JSON.stringify(cacheKey);\n"
141-
@io << ident ident ident ident "const cache = await hook.getCache(cacheKeyEncoded, cacheVersion);\n"
141+
@io << ident ident ident ident "const decodedKey = JSON.stringify(_cacheKey);\n"
142142
@io << ident ident ident ident "if (cache && (!cache.expirationDate || cache.expirationDate > new Date())) return cache.ret;\n"
143143
@io << ident ident ident "} catch(e) {console.log(JSON.stringify(e));}\n"
144144
@io << ident ident "}\n"

0 commit comments

Comments
 (0)