Run scheduled backups in an isolated subprocess

This commit is contained in:
syntaxbullet
2026-09-08 16:12:53 +02:00
parent 31e4f3b2ef
commit b0950cb4b4
4 changed files with 98 additions and 14 deletions

View File

@@ -15,6 +15,7 @@ if (process.env.NODE_ENV !== "production") {
}
const backups = process.env.NODE_ENV === "production" ? startBackups(sqlite, backupConfig(databasePath)) : undefined;
await backups?.ready;
if (import.meta.hot) import.meta.hot.dispose(() => backups?.stop());
const reminders = process.env.NODE_ENV === "production" ? startReminders(db, { token: readDiscordSharingConfig().token, origin: readAuthConfig().origin, commandsAvailable: /^[a-f\d]{64}$/i.test(process.env.DISCORD_PUBLIC_KEY ?? "") && Boolean(readAuthConfig().clientId) }) : undefined;