feat: add opt-in daily Discord reminders with quiet hours

This commit is contained in:
syntaxbullet
2026-09-04 18:45:42 +02:00
parent 16d92f171c
commit 1208e93953
22 changed files with 2367 additions and 9 deletions

View File

@@ -72,7 +72,10 @@ export function restoreBackup(source: string, destination: string) {
try {
copyFileSync(source, temporary, constants.COPYFILE_EXCL); chmodSync(temporary, 0o600);
const restored = new Database(temporary);
try { restored.exec("PRAGMA journal_mode=DELETE; DELETE FROM sessions;"); } finally { restored.close(); }
try {
restored.exec("PRAGMA journal_mode=DELETE; DELETE FROM sessions;");
if (restored.query("SELECT name FROM sqlite_master WHERE name = 'reminder_settings'").get()) restored.exec("UPDATE reminder_settings SET enabled=0");
} finally { restored.close(); }
verifyBackup(temporary); durable(temporary);
// Link is exclusive: a concurrently-created destination is never overwritten.
linkSync(temporary, destination);