storage: make remount async
This commit is contained in:
+1
-7
@@ -67,12 +67,6 @@ const COLLECTD_CONFIG_EJS = fs.readFileSync(__dirname + '/collectd/cloudron-back
|
||||
|
||||
const BACKUPS_FIELDS = [ 'id', 'remotePath', 'label', 'identifier', 'creationTime', 'packageVersion', 'type', 'dependsOnJson', 'state', 'manifestJson', 'format', 'preserveSecs', 'encryptionVersion' ];
|
||||
|
||||
// helper until all storage providers have been ported
|
||||
function maybePromisify(func) {
|
||||
if (util.types.isAsyncFunction(func)) return func;
|
||||
return util.promisify(func);
|
||||
}
|
||||
|
||||
function postProcess(result) {
|
||||
assert.strictEqual(typeof result, 'object');
|
||||
|
||||
@@ -385,5 +379,5 @@ async function remount(auditSource) {
|
||||
const func = storage.api(backupConfig.provider);
|
||||
if (!func) throw new BoxError(BoxError.BAD_FIELD, 'unknown storage provider');
|
||||
|
||||
await maybePromisify(storage.api(backupConfig.provider).remount)(backupConfig);
|
||||
await storage.api(backupConfig.provider).remount(backupConfig);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user