shellphone.app/app/cron-jobs/purge-expired-sessions.ts
2022-05-14 12:22:06 +02:00

15 lines
263 B
TypeScript

import db from "~/utils/db.server";
import { CronJob } from "~/utils/queue.server";
export default CronJob(
"purge expired sessions",
async () => {
await db.session.deleteMany({
where: {
expiresAt: { lt: new Date() },
},
});
},
"0 0 * * *",
);