backups: move mount status to separate route

This commit is contained in:
Girish Ramakrishnan
2023-04-30 17:21:18 +02:00
parent 898413bfd4
commit 883915c9d3
7 changed files with 42 additions and 9 deletions

View File

@@ -406,13 +406,7 @@ async function getBackupConfig() {
const value = await get(exports.BACKUP_CONFIG_KEY);
if (value === null) return gDefaults[exports.BACKUP_CONFIG_KEY];
const backupConfig = JSON.parse(value); // provider, token, password, region, prefix, bucket
if (mounts.isManagedProvider(backupConfig.provider) || backupConfig.provider === 'mountpoint') {
const hostPath = mounts.isManagedProvider(backupConfig.provider) ? paths.MANAGED_BACKUP_MOUNT_DIR : backupConfig.mountPoint;
backupConfig.mountStatus = await mounts.getStatus(backupConfig.provider, hostPath); // { state, message }
}
const backupConfig = JSON.parse(value); // { provider, token, password, region, prefix, bucket }
return backupConfig;
}