eslint: add no-shadow
This commit is contained in:
+6
-6
@@ -340,9 +340,9 @@ async function listDir(config, remotePath, batchSize, marker) {
|
||||
// https://github.com/aws/aws-sdk-js/blob/2b6bcbdec1f274fe931640c1b61ece999aae7a19/lib/util.js#L41
|
||||
// https://github.com/GeorgePhillips/node-s3-url-encode/blob/master/index.js
|
||||
// See aws-sdk-js/issues/1302
|
||||
function encodeCopySource(bucket, path) {
|
||||
function encodeCopySource(bucket, filePath) {
|
||||
// AWS percent-encodes some extra non-standard characters in a URI
|
||||
const output = encodeURI(path).replace(/[+!"#$@&'()*,:;=?@]/g, function(ch) {
|
||||
const output = encodeURI(filePath).replace(/[+!"#$@&'()*,:;=?@]/g, function(ch) {
|
||||
return '%' + ch.charCodeAt(0).toString(16).toUpperCase();
|
||||
});
|
||||
|
||||
@@ -440,10 +440,10 @@ async function cleanup(config, progressCallback) {
|
||||
progressCallback({ message: `Cleaning up any aborted multi-part uploads. count:${uploads.Uploads?.length || 0} truncated:${uploads.IsTruncated}` });
|
||||
if (!uploads.Uploads) return;
|
||||
|
||||
for (const upload of uploads.Uploads) {
|
||||
if (Date.now() - new Date(upload.Initiated) < 3 * 24 * 60 * 60 * 1000) continue; // 3 days ago
|
||||
progressCallback({ message: `Cleaning up multi-part upload uploadId:${upload.UploadId} key:${upload.Key}` });
|
||||
await safe(s3.abortMultipartUpload({ Bucket: config.bucket, Key: upload.Key, UploadId: upload.UploadId }), { debug }); // ignore error
|
||||
for (const multipartUpload of uploads.Uploads) {
|
||||
if (Date.now() - new Date(multipartUpload.Initiated) < 3 * 24 * 60 * 60 * 1000) continue; // 3 days ago
|
||||
progressCallback({ message: `Cleaning up multi-part upload uploadId:${multipartUpload.UploadId} key:${multipartUpload.Key}` });
|
||||
await safe(s3.abortMultipartUpload({ Bucket: config.bucket, Key: multipartUpload.Key, UploadId: multipartUpload.UploadId }), { debug }); // ignore error
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user