only clear backup cache if specific fields changed
This commit is contained in:
@@ -416,7 +416,11 @@ function setBackupConfig(backupConfig, callback) {
|
||||
delete backupConfig.password;
|
||||
}
|
||||
|
||||
backups.cleanupCacheFilesSync();
|
||||
// if any of these changes, we have to clear the cache
|
||||
if ([ 'format', 'provider', 'prefix', 'bucket', 'region', 'endpoint', 'backupFolder', 'mountPoint', 'encryption' ].some(p => backupConfig[p] !== currentConfig[p])) {
|
||||
debug('setBackupConfig: clearing backup cache');
|
||||
backups.cleanupCacheFilesSync();
|
||||
}
|
||||
|
||||
settingsdb.set(exports.BACKUP_CONFIG_KEY, JSON.stringify(backupConfig), function (error) {
|
||||
if (error) return callback(error);
|
||||
|
||||
Reference in New Issue
Block a user