Typst Compile System Update

This commit is contained in:
2026-05-21 22:41:04 -04:00
parent a44babed9f
commit 997c0c7262
7 changed files with 60 additions and 173 deletions
-8
View File
@@ -11,14 +11,6 @@ export default async(Discord: any, client: BotClient) => {
client.emit("birthdayCheck");
}, ms('30m'));
// Clean up old typst files daily
setInterval(() => {
client.emit("typstCleanup");
}, ms('24h'));
// Run cleanup once on startup
client.emit("typstCleanup");
} catch (err) {
console.log(err);
} finally {
+1 -20
View File
@@ -1,20 +1 @@
import BotClient from "../../../libs/BotClient";
export default async(Discord: any, client: BotClient) => {
console.log("[TypstCleanup] Running cleanup for old typst files...");
// Delete files older than 1 day (after the question day passes)
const result = await client.typst.cleanupOldFiles(1);
if (result.deleted > 0) {
console.log(`[TypstCleanup] ✅ Successfully cleaned up ${result.deleted} old typst file(s)`);
}
if (result.errors > 0) {
console.error(`[TypstCleanup] ⚠️ Encountered ${result.errors} error(s) during cleanup`);
}
if (result.deleted === 0 && result.errors === 0) {
console.log("[TypstCleanup] No old files to clean up");
}
}
export default async() => {};