mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-18 11:40:39 +09:00
fix: clean up orphaned .sql on compression failure and fix stale startup log
- backup-lib: delete uncompressed .sql file in catch block when gzip compression fails, preventing silent disk usage accumulation - server: replace stale retentionDays scalar with retentionSource in startup log since retention is now read from DB on each backup tick
This commit is contained in:
parent
fcbae62baf
commit
b1e457365b
2 changed files with 4 additions and 1 deletions
|
|
@ -763,6 +763,9 @@ export async function runDatabaseBackup(opts: RunDatabaseBackupOptions): Promise
|
||||||
if (existsSync(backupFile)) {
|
if (existsSync(backupFile)) {
|
||||||
try { unlinkSync(backupFile); } catch { /* ignore */ }
|
try { unlinkSync(backupFile); } catch { /* ignore */ }
|
||||||
}
|
}
|
||||||
|
if (existsSync(sqlFile)) {
|
||||||
|
try { unlinkSync(sqlFile); } catch { /* ignore */ }
|
||||||
|
}
|
||||||
throw error;
|
throw error;
|
||||||
} finally {
|
} finally {
|
||||||
await sql.end();
|
await sql.end();
|
||||||
|
|
|
||||||
|
|
@ -670,7 +670,7 @@ export async function startServer(): Promise<StartedServer> {
|
||||||
logger.info(
|
logger.info(
|
||||||
{
|
{
|
||||||
intervalMinutes: config.databaseBackupIntervalMinutes,
|
intervalMinutes: config.databaseBackupIntervalMinutes,
|
||||||
retentionDays: config.databaseBackupRetentionDays,
|
retentionSource: "instance-settings-db",
|
||||||
backupDir: config.databaseBackupDir,
|
backupDir: config.databaseBackupDir,
|
||||||
},
|
},
|
||||||
"Automatic database backups enabled",
|
"Automatic database backups enabled",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue