feat: Calendar Cache (#11185)

This commit is contained in:
Omar López authored and GitHub committed 2023-09-14 15:19:39 -07:00
1 parent 9bc40a3eb6
commit c95917cceb
7 files changed
+468 -266

No files matched your search

@@ -0,0 +1,16 @@
import type { NextApiRequest, NextApiResponse } from "next";
import prisma from "@calcom/prisma";
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
const deleted = await prisma.calendarCache.deleteMany({
where: {
// Delete all cache entries that expired before now
expiresAt: {
lte: new Date(Date.now()),
},
},
});
res.json({ ok: true, count: deleted.count });
}
+8
View File
@@ -0,0 +1,8 @@
{
"crons": [
{
"path": "/api/cron/calendar-cache-cleanup",
"schedule": "0 5 * * *"
}
]
}