storage: make remount async
This commit is contained in:
@@ -281,7 +281,7 @@ function validateBackupTarget(folder) {
|
||||
async function remount(apiConfig) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
|
||||
if (apiConfig.provider === PROVIDER_FILESYSTEM || apiConfig.provider === PROVIDER_MOUNTPOINT) throw new BoxError(BoxError.NOT_SUPPORTED);
|
||||
if (apiConfig.provider === PROVIDER_FILESYSTEM || apiConfig.provider === PROVIDER_MOUNTPOINT) return;
|
||||
|
||||
await mounts.remount(mounts.mountObjectFromBackupConfig(apiConfig));
|
||||
}
|
||||
|
||||
@@ -262,11 +262,8 @@ function removeDir(apiConfig, pathPrefix) {
|
||||
return events;
|
||||
}
|
||||
|
||||
function remount(apiConfig, callback) {
|
||||
async function remount(apiConfig) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
return callback(new BoxError(BoxError.NOT_SUPPORTED));
|
||||
}
|
||||
|
||||
function testConfig(apiConfig, callback) {
|
||||
|
||||
@@ -140,13 +140,12 @@ function removeDir(apiConfig, pathPrefix) {
|
||||
return events;
|
||||
}
|
||||
|
||||
function remount(apiConfig, callback) {
|
||||
async function remount(apiConfig) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
// Result: none
|
||||
|
||||
callback(new BoxError(BoxError.NOT_IMPLEMENTED, 'remount is not implemented'));
|
||||
throw new BoxError(BoxError.NOT_IMPLEMENTED, 'remount is not implemented');
|
||||
}
|
||||
|
||||
function testConfig(apiConfig, callback) {
|
||||
|
||||
@@ -126,11 +126,8 @@ function removeDir(apiConfig, pathPrefix) {
|
||||
return events;
|
||||
}
|
||||
|
||||
function remount(apiConfig, callback) {
|
||||
async function remount(apiConfig) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
callback(null);
|
||||
}
|
||||
|
||||
function testConfig(apiConfig, callback) {
|
||||
|
||||
@@ -457,11 +457,8 @@ function removeDir(apiConfig, pathPrefix) {
|
||||
return events;
|
||||
}
|
||||
|
||||
function remount(apiConfig, callback) {
|
||||
async function remount(apiConfig) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
return callback(new BoxError(BoxError.NOT_SUPPORTED));
|
||||
}
|
||||
|
||||
function testConfig(apiConfig, callback) {
|
||||
|
||||
Reference in New Issue
Block a user