Add progress messages for multi-part copy

This commit is contained in:
Girish Ramakrishnan
2019-03-26 11:58:32 -07:00
parent 121dc85e40
commit 9a3603fea3

View File

@@ -322,9 +322,13 @@ function copy(apiConfig, oldFilePath, newFilePath) {
UploadId: uploadId
};
events.emit('progress', `Copying part ${params.PartNumber} - ${params.CopySource} ${params.CopySourceRange}`);
s3.uploadPartCopy(params, function (error, result) {
if (error) return done(error);
events.emit('progress', `Uploaded part ${params.PartNumber} - Etag: ${result.CopyPartResult.ETag}`);
uploadedParts.push({ ETag: result.CopyPartResult.ETag, PartNumber: partNumber });
if (endBytes < size) {
@@ -340,6 +344,8 @@ function copy(apiConfig, oldFilePath, newFilePath) {
UploadId: uploadId
};
events.emit('progress', `Finishing multipart copy - ${params.Key}`);
s3.completeMultipartUpload(params, done);
}).on('retry', function (response) {
++retryCount;