Skip to content

Commit

Permalink
fix: remove ttl if 0
Browse files Browse the repository at this point in the history
resolves #328
  • Loading branch information
atinux committed Oct 18, 2024
1 parent 2a917e1 commit 1f67732
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/runtime/cache/driver.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ export default defineDriver((driverOpts) => {
}

options.metadata = {
ttl: options.ttl,
mtime: Date.now(),
size: value.length,
path: event?.path,
...options.metadata
}
if (!options.ttl) {
delete options.ttl
}
return driver.setItem(key, value, options)
}
}
Expand Down

0 comments on commit 1f67732

Please sign in to comment.