1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-14 01:45:36 +02:00
Files
misskey/src/daemons/janitor.ts

21 lines
406 B
TypeScript

// TODO: 消したい
const interval = 30 * 60 * 1000;
import { AttestationChallenges } from '@/models/index';
import { LessThan } from 'typeorm';
/**
* Clean up database occasionally
*/
export default function() {
async function tick() {
await AttestationChallenges.delete({
createdAt: LessThan(new Date(new Date().getTime() - 5 * 60 * 1000))
});
}
tick();
setInterval(tick, interval);
}