mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-09 20:12:10 +10:00
24 lines
458 B
TypeScript
24 lines
458 B
TypeScript
import prisma from "~/server/internal/db/database";
|
|
|
|
export default defineTask({
|
|
meta: {
|
|
name: "cleanup:invitations",
|
|
},
|
|
async run() {
|
|
console.log("[Task cleanup:invitations]: Cleaning invitations");
|
|
|
|
const now = new Date();
|
|
|
|
await prisma.invitation.deleteMany({
|
|
where: {
|
|
expires: {
|
|
lt: now,
|
|
},
|
|
},
|
|
});
|
|
|
|
console.log("[Task cleanup:invitations]: Done");
|
|
return { result: true };
|
|
},
|
|
});
|