mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-13 21:35:02 +00:00
13 lines
490 B
TypeScript
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);
|
|
}
|