fix: delete old cached views

This commit is contained in:
diced
2026-04-09 14:51:27 -07:00
parent eb1c39933a
commit 1a1bc46667

View File

@@ -6,11 +6,12 @@ import { datasource } from '@/lib/datasource';
import { prisma } from '@/lib/db';
import { log } from '@/lib/logger';
import { guess } from '@/lib/mimes';
import { TimedCache } from '@/lib/timedCache';
import typedPlugin from '@/server/typedPlugin';
import { FastifyReply, FastifyRequest } from 'fastify';
const viewsCache = new Map<string, number>();
const VIEW_WINDOW = 5 * 1000;
const viewsCache = new TimedCache<string, number>(VIEW_WINDOW);
type Params = {
id: string;