storage: make copy async

This commit is contained in:
Girish Ramakrishnan
2022-04-30 16:01:42 -07:00
parent 8ceb80dc44
commit ea01586b52
7 changed files with 54 additions and 95 deletions

View File

@@ -92,16 +92,13 @@ function downloadDir(apiConfig, backupFilePath, destDir) {
return events;
}
function copy(apiConfig, oldFilePath, newFilePath) {
async function copy(apiConfig, oldFilePath, newFilePath, progressCallback) {
assert.strictEqual(typeof apiConfig, 'object');
assert.strictEqual(typeof oldFilePath, 'string');
assert.strictEqual(typeof newFilePath, 'string');
assert.strictEqual(typeof progressCallback, 'function');
debug('copy: %s -> %s', oldFilePath, newFilePath);
var events = new EventEmitter();
process.nextTick(function () { events.emit('done', null); });
return events;
debug(`copy: ${oldFilePath} -> ${newFilePath}`);
}
async function remove(apiConfig, filename) {