Skip to content

Commit

Permalink
Update src/runtime/cache.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 authored Jan 20, 2023
1 parent d024877 commit 258249e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function defineCachedFunction<T = any>(

const _resolve = async () => {
if (!pending[key]) {
if (entry.value && (opts.staleMaxAge || 0) >= 0) {
if (entry.value !== undefined && (opts.staleMaxAge || 0) >= 0) {
// Remove cached entry to prevent using expired cache on concurrent requests
entry.value = undefined;
entry.integrity = undefined;
Expand Down

0 comments on commit 258249e

Please sign in to comment.