Asjas/prisma-redis-middleware

TypeScript type for invalidationTTL error

pkellner opened this issue · 2 comments

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);
  },
});

image

Asjas commented

It's called referencesTTL.