Skip to content

Commit

Permalink
cacheable - fix: if layer 2 has item then use expires or set to undef…
Browse files Browse the repository at this point in the history
…ined

cacheable - fix: if layer 2 has item then use expires or set to undefined
  • Loading branch information
jaredwray committed Jan 8, 2025
1 parent e2e0352 commit 4e6683d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/cacheable/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export class Cacheable extends Hookified {
const rawResult = await this._secondary.get(key, {raw: true});
if (rawResult) {
result = rawResult.value as T;
const finalTtl = rawResult.expires ?? shorthandToMilliseconds(this._ttl);
const finalTtl = rawResult.expires ?? undefined;
await this._primary.set(key, result, finalTtl);
}
}
Expand Down

0 comments on commit 4e6683d

Please sign in to comment.