mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-26 13:16:43 -06:00
d071d18dd7
* wip * wip * fix * clean up * Update tsconfig.json * Update activitypub.ts * wip
20 lines
410 B
TypeScript
20 lines
410 B
TypeScript
// TODO: 消したい
|
|
|
|
const interval = 30 * 60 * 1000;
|
|
import { AttestationChallenges } from '@/models/index.js';
|
|
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);
|
|
}
|