TypeScript type for invalidationTTL error
pkellner opened this issue · 2 comments
pkellner commented
I'm using Typescript 5.1 and get an error pointing at invalidationTTL. I used the "as any" to get it to stop for now.
const cacheMiddleware = createPrismaRedisCache({
models: [{ model: "CodeCampYear", cacheTime: 7200 }], // all models cache except excluded, this just lets you set cache time for each model
excludeModels: ["MeetupCodeCampYear"],
storage: {
type: "redis",
options: { client: redis, invalidation: { invalidationTTL: 300 } as any },
},
cacheTime: 60, // defaults to 1 minute
onHit: (key: string) => {
console.log("Hit: ✅", key);
},
onMiss: (key: string) => {
console.log("Miss: ❌", key);
},
});
Asjas commented
It's called referencesTTL
.
pkellner commented
Thanks. I found it in this file. https://github.com/Asjas/prisma-redis-middleware/blob/main/example/src/index.ts