3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-13 21:35:02 +00:00
zeppelin/backend/src/data/loops/expiredArchiveDeletionLoop.ts
Dragory 45e3fe2ef0
chore: esm imports
This will make merging this into 'next' much easier.
2024-08-11 21:58:52 +03:00

13 lines
490 B
TypeScript

// tslint:disable:no-console
import { lazyMemoize, MINUTES } from "../../utils.js";
import { Archives } from "../Archives.js";
const LOOP_INTERVAL = 15 * MINUTES;
const getArchivesRepository = lazyMemoize(() => new Archives());
export async function runExpiredArchiveDeletionLoop() {
console.log("[EXPIRED ARCHIVE DELETION LOOP] Deleting expired archives");
await getArchivesRepository().deleteExpiredArchives();
setTimeout(() => runExpiredArchiveDeletionLoop(), LOOP_INTERVAL);
}