mounts: always return message when getting status
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user