prisma-redis-middleware
prisma-redis-middleware copied to clipboard
General cacheTime is in seconds instead of milliseconds
Describe the bug
When using this config the cacheTime refers to seconds, not milliseconds as described in README.
const CacheMiddleware = createPrismaRedisCache({
cacheTime: 10,
onHit: (key) => {
console.log('hit', key)
},
onMiss: (key) => {
console.log('miss', key)
},
onError: (key) => {
console.log('error', key)
},
})
To Reproduce Steps to reproduce the behavior:
- Setup middleware with config from above
- Run query
- Wait 2 seconds and run query again
onHitis triggered
Expected behavior
onMiss should be triggered
Desktop (please complete the following information):
- OS: MacOS 12.4
- Node: 16.12.0
- Version 4.0.8