Limit max backups to settings only

This commit is contained in:
Cohee 2023-08-29 23:28:44 +03:00
parent 7b51d94e1b
commit 8d2c84c6ef
1 changed files with 1 additions and 1 deletions

View File

@ -4134,7 +4134,7 @@ function backupSettings() {
const backupFile = path.join(directories.backups, `settings_${generateTimestamp()}.json`);
fs.copyFileSync(SETTINGS_FILE, backupFile);
let files = fs.readdirSync(directories.backups);
let files = fs.readdirSync(directories.backups).filter(f => f.startsWith('settings_'));
if (files.length > MAX_BACKUPS) {
files = files.map(f => path.join(directories.backups, f));
files.sort((a, b) => fs.statSync(a).mtimeMs - fs.statSync(b).mtimeMs);