storage: make remove and removeDir async
This commit is contained in:
@@ -104,25 +104,19 @@ function copy(apiConfig, oldFilePath, newFilePath) {
|
||||
return events;
|
||||
}
|
||||
|
||||
function remove(apiConfig, filename, callback) {
|
||||
async function remove(apiConfig, filename) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
assert.strictEqual(typeof filename, 'string');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
debug('remove: %s', filename);
|
||||
|
||||
callback(null);
|
||||
debug(`remove: ${filename}`);
|
||||
}
|
||||
|
||||
function removeDir(apiConfig, pathPrefix) {
|
||||
function removeDir(apiConfig, pathPrefix, progressCallback) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
assert.strictEqual(typeof pathPrefix, 'string');
|
||||
assert.strictEqual(typeof progressCallback, 'function');
|
||||
|
||||
debug('removeDir: %s', pathPrefix);
|
||||
|
||||
var events = new EventEmitter();
|
||||
process.nextTick(function () { events.emit('done', null); });
|
||||
return events;
|
||||
debug(`removeDir: ${pathPrefix}`);
|
||||
}
|
||||
|
||||
async function remount(apiConfig) {
|
||||
|
||||
Reference in New Issue
Block a user