Skip to content

Commit 421d8fd

Browse files
committed
feat: Exclude scanning GLACIER and DEEP_ARCHIVE
1 parent f037650 commit 421d8fd

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

dth/client.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -268,15 +268,18 @@ func (c *S3Client) ListObjects(ctx context.Context, continuationToken, prefix *s
268268
return nil, err
269269
}
270270

271-
len := len(output.Contents)
272-
result := make([]*Object, len, len)
271+
length := len(output.Contents)
272+
result := make([]*Object, 0, length)
273273

274-
for i, obj := range output.Contents {
274+
for _, obj := range output.Contents {
275275
// log.Printf("key=%s size=%d", *obj.Key, obj.Size)
276-
result[i] = &Object{
276+
if obj.StorageClass == "GLACIER" || obj.StorageClass == "DEEP_ARCHIVE" {
277+
continue
278+
}
279+
result = append(result, &Object{
277280
Key: *obj.Key,
278281
Size: obj.Size,
279-
}
282+
})
280283
}
281284

282285
return result, nil

0 commit comments

Comments
 (0)