Updated stuff
All checks were successful
Code Analysis and Production Deploy / analyze (push) Successful in 6m4s
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Successful in 2m10s

This commit is contained in:
Torsten Schulz (local)
2026-06-12 16:49:00 +02:00
parent 44d441811c
commit e537839e28
10 changed files with 197 additions and 157 deletions

View File

@@ -2,6 +2,7 @@ import { promises as fs } from 'fs'
import path from 'path'
const DEFAULT_MAX_BACKUPS = Number.parseInt(process.env.DATA_FILE_BACKUP_MAX || '40', 10)
let backupSequence = 0
function getProjectRoot() {
const cwd = process.cwd()
@@ -30,8 +31,9 @@ function sanitizeFileKey(filePath) {
}
function buildBackupName(date = new Date()) {
const sequence = (backupSequence++).toString(36).padStart(6, '0')
const randomSuffix = Math.random().toString(36).slice(2, 8)
return `${date.toISOString().replace(/[:.]/g, '-')}-${randomSuffix}.bak`
return `${date.toISOString().replace(/[:.]/g, '-')}-${sequence}-${randomSuffix}.bak`
}
export function resolveDataFileBackupPath(backupDir, backupName) {