Discord-InterChat/InterChat

View on GitHub
src/scheduled/tasks/deleteExpiredInvites.ts

Summary

Maintainability
A
0 mins
Test Coverage
import db from '#utils/Db.js';

export default async () => {
  const olderThan1h = new Date(Date.now() - 60 * 60 * 1_000);
  await db.hubInvite.deleteMany({ where: { expires: { lte: olderThan1h } } }).catch(() => null);
};