Skip to content

Commit

Permalink
Temporarily disable backups in production
Browse files Browse the repository at this point in the history
Will refactor them to to happen after actual backup run, as was adding 10+ minutes to the time it ook the backup job to run, which is longer than I want to buffer/suspend updates for.
  • Loading branch information
iaincollins committed Sep 24, 2024
1 parent 5c3c72d commit a21a8d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ if (SAVE_PAYLOAD_EXAMPLES === true &&
socket.subscribe('')
console.log('Connected to EDDN')

// If a backup log does not exist, being a backup immediately
// If a backup log does not exist, begin a backup immediately
if (!fs.existsSync(ARDENT_BACKUP_LOG)) {
console.log('No backup log found, starting backup now')
enableDatabaseWriteLock()
Expand Down
6 changes: 5 additions & 1 deletion scripts/backup.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,15 @@ const MIN_ROWS_FOR_BACKUP_VALIDATION = 100
backupDatabase(systemsDb, pathToSystemsDbBackup)
verifyResults.push(verifyBackup(pathToSystemsDbBackup, ['systems'], TEN_MB_IN_BYTES))

// Temporarily leaving backup compression disabled, as needs to be de-coupled
// from the main backup job, to avoid exending the main backup task runtime.
/*
const compressedBackups = []
compressedBackups.push(compressDatabase(pathToLocationsDbBackup))
compressedBackups.push(compressDatabase(pathToTradeDbBackup))
compressedBackups.push(compressDatabase(pathToStationsDbBackup))
compressedBackups.push(compressDatabase(pathToSystemsDbBackup))
*/

console.timeEnd('Backup complete')
writeBackupLog(`Completed backup at ${new Date().toISOString()}`)
Expand All @@ -86,7 +90,7 @@ const MIN_ROWS_FOR_BACKUP_VALIDATION = 100
dataDirSizeInBytes,
freeDiskSpaceInBytes,
databases: verifyResults,
compressedBackups,
// compressedBackups,
timestamp: new Date().toISOString()
}
fs.writeFileSync(path.join(ARDENT_DATA_DIR, 'backup.json'), JSON.stringify(backupReport, null, 2))
Expand Down

0 comments on commit a21a8d8

Please sign in to comment.