mirror of
https://github.com/fluxerapp/fluxer.git
synced 2026-12-02 15:12:30 -08:00
fix(api): skip repeated keys when moving uploads off seaweedfs
This commit is contained in:
1 file changed
+3
-1
@@ -152,11 +152,13 @@ export interface StorageMigrationSource {
|
||||
function s3MigrationSource(client: S3Client): StorageMigrationSource {
|
||||
return {
|
||||
async *list(bucket) {
|
||||
const seen = new Set<string>();
|
||||
let token: string | undefined;
|
||||
do {
|
||||
const page = await client.send(new ListObjectsV2Command({Bucket: bucket, ContinuationToken: token}));
|
||||
for (const object of page.Contents ?? []) {
|
||||
if (object.Key === undefined) continue;
|
||||
if (object.Key === undefined || seen.has(object.Key)) continue;
|
||||
seen.add(object.Key);
|
||||
yield {key: object.Key, size: object.Size ?? 0, lastModified: object.LastModified};
|
||||
}
|
||||
if (page.IsTruncated && !page.NextContinuationToken) {
|
||||
|
||||
Reference in new issue
Block a user