mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-09 20:12:10 +10:00
* feat: historical tasks in database, better scheduling, and unified API for accessing tasks * feat: new UI for everything * fix: add translations and fix formatting
25 lines
529 B
TypeScript
25 lines
529 B
TypeScript
import prisma from "~/server/internal/db/database";
|
|
import { defineDropTask } from "..";
|
|
|
|
export default defineDropTask({
|
|
buildId: () => `cleanup:invitations:${new Date().toISOString()}`,
|
|
name: "Cleanup Invitations",
|
|
acls: ["system:maintenance:read"],
|
|
taskGroup: "cleanup:invitations",
|
|
async run({ log }) {
|
|
log("Cleaning invitations");
|
|
|
|
const now = new Date();
|
|
|
|
await prisma.invitation.deleteMany({
|
|
where: {
|
|
expires: {
|
|
lt: now,
|
|
},
|
|
},
|
|
});
|
|
|
|
log("Done");
|
|
},
|
|
});
|