@cloudbase/manager-node 4.4.3-beta.0 → 4.4.4-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/storage/index.js +15 -16
- package/package.json +1 -1
package/lib/storage/index.js
CHANGED
|
@@ -683,24 +683,23 @@ class StorageService {
|
|
|
683
683
|
const cos = this.getCos();
|
|
684
684
|
const getBucket = util_1.default.promisify(cos.getBucket).bind(cos);
|
|
685
685
|
const prefixKey = this.getCloudKey(prefix);
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
moreFiles = await this.walkCloudDirCustom({
|
|
697
|
-
bucket,
|
|
698
|
-
region,
|
|
699
|
-
prefix: prefixKey,
|
|
700
|
-
marker: res.NextMarker
|
|
686
|
+
let currentMarker = marker;
|
|
687
|
+
let isTruncated = true;
|
|
688
|
+
// 使用循环替代递归
|
|
689
|
+
while (isTruncated) {
|
|
690
|
+
const res = await getBucket({
|
|
691
|
+
Bucket: bucket,
|
|
692
|
+
Region: region,
|
|
693
|
+
Prefix: prefixKey,
|
|
694
|
+
MaxKeys: 100,
|
|
695
|
+
Marker: currentMarker
|
|
701
696
|
});
|
|
697
|
+
fileList.push(...res.Contents);
|
|
698
|
+
isTruncated = res.IsTruncated === 'true' || res.IsTruncated === true;
|
|
699
|
+
if (isTruncated) {
|
|
700
|
+
currentMarker = res.NextMarker;
|
|
701
|
+
}
|
|
702
702
|
}
|
|
703
|
-
fileList.push(...moreFiles);
|
|
704
703
|
return fileList;
|
|
705
704
|
}
|
|
706
705
|
/**
|