mounts: always return message when getting status

This commit is contained in:
Girish Ramakrishnan
2025-11-05 16:38:11 +01:00
parent 2ea7847d4f
commit de84b5113c
5 changed files with 11 additions and 10 deletions

View File

@@ -70,9 +70,9 @@ async function getStatus(config) {
let hostPath;
if (mounts.isManagedProvider(config._provider)) {
hostPath = config._managedMountPath;
} else if (config._provider === 'mountpoint') {
} else if (config._provider === mounts.MOUNT_TYPE_MOUNTPOINT) {
hostPath = config.mountPoint;
} else if (config._provider === 'filesystem') {
} else if (config._provider === mounts.MOUNT_TYPE_FILESYSTEM) {
hostPath = config.backupDir;
}

View File

@@ -64,7 +64,7 @@ async function getStatus(apiConfig) {
const query = { prefix: path.join(apiConfig.prefix, 'snapshot'), autoPaginate: false, maxResults: 1 };
const [listError] = await safe(bucket.getFiles(query));
if (listError) return { state: 'inactive', message: `Failed to get files: ${listError.message}` };
return { state: 'active' };
return { state: 'active', message: '' };
}
async function upload(apiConfig, remotePath) {

View File

@@ -172,7 +172,7 @@ async function getStatus(apiConfig) {
const [listError] = await safe(s3.listObjectsV2(listParams));
if (listError) return { status: 'inactive', message: `Error listing objects. ${formatError(listError)}` };
return { state: 'active' };
return { state: 'active', message: '' };
}
async function upload(apiConfig, remotePath) {