Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Nov 12, 2024
1 parent 3874492 commit 1956cd0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/runtime/cache/server/api/_hub/cache/[...key].get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ export default eventHandler(async (event) => {

if (!metadata.expires && metadata.ttl) {
metadata.expires = metadata.mtime + (metadata.ttl * 1000)
} else if (metadata.expires) {
metadata.expires = 'never'
}
const entry = {
key,
Expand Down
2 changes: 1 addition & 1 deletion test/cache.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fs from 'node:fs/promises'
import { describe, it, expect } from 'vitest'
import { setup, $fetch } from '@nuxt/test-utils'

const cacheListFields = ['duration', 'key', 'mtime', 'size']
const cacheListFields = ['duration', 'expires', 'key', 'mtime', 'size']

describe('KV', async () => {
// clean up
Expand Down

0 comments on commit 1956cd0

Please sign in to comment.