Move all List calls to honor new maxObjectList limit (#8459)

This commit is contained in:
Harshavardhana 2019-10-30 13:20:01 -07:00 committed by kannappanr
parent 8cc5ecec23
commit 599aae5ba6
6 changed files with 12 additions and 10 deletions

View File

@ -128,7 +128,7 @@ func (api objectAPIHandlers) ListBucketObjectVersionsHandler(w http.ResponseWrit
// ListObjectsV2Handler - GET Bucket (List Objects) Version 2.
// --------------------------
// This implementation of the GET operation returns some or all (up to 1000)
// This implementation of the GET operation returns some or all (up to 10000)
// of the objects in a bucket. You can use the request parameters as selection
// criteria to return a subset of the objects in a bucket.
//
@ -210,7 +210,7 @@ func (api objectAPIHandlers) ListObjectsV2Handler(w http.ResponseWriter, r *http
// ListObjectsV1Handler - GET Bucket (List Objects) Version 1.
// --------------------------
// This implementation of the GET operation returns some or all (up to 1000)
// This implementation of the GET operation returns some or all (up to 10000)
// of the objects in a bucket. You can use the request parameters as selection
// criteria to return a subset of the objects in a bucket.
//

View File

@ -49,7 +49,7 @@ func listServerConfigHistory(ctx context.Context, objAPI ObjectLayer) ([]madmin.
// List all kvs
marker := ""
for {
res, err := objAPI.ListObjects(ctx, minioMetaBucket, minioConfigHistoryPrefix, marker, "", 1000)
res, err := objAPI.ListObjects(ctx, minioMetaBucket, minioConfigHistoryPrefix, marker, "", maxObjectList)
if err != nil {
return nil, err
}

View File

@ -135,7 +135,7 @@ func lifecycleRound(ctx context.Context, objAPI ObjectLayer) error {
// List all objects and calculate lifecycle action based on object name & object modtime
marker := ""
for {
res, err := objAPI.ListObjects(ctx, bucket.Name, commonPrefix, marker, "", 1000)
res, err := objAPI.ListObjects(ctx, bucket.Name, commonPrefix, marker, "", maxObjectList)
if err != nil {
continue
}

View File

@ -568,7 +568,7 @@ func listIAMConfigItems(objectAPI ObjectLayer, pathPrefix string, dirs bool,
marker := ""
for {
lo, err := objectAPI.ListObjects(context.Background(),
minioMetaBucket, pathPrefix, marker, SlashSeparator, 1000)
minioMetaBucket, pathPrefix, marker, SlashSeparator, maxObjectList)
if err != nil {
select {
case ch <- itemOrErr{Err: err}:

View File

@ -418,7 +418,8 @@ func (web *webAPIHandlers) ListObjects(r *http.Request, args *ListObjectsArgs, r
nextMarker := ""
// Fetch all the objects
for {
result, err := core.ListObjects(args.BucketName, args.Prefix, nextMarker, SlashSeparator, 1000)
result, err := core.ListObjects(args.BucketName, args.Prefix, nextMarker, SlashSeparator,
maxObjectList)
if err != nil {
return toJSONError(ctx, err, args.BucketName)
}
@ -532,7 +533,7 @@ func (web *webAPIHandlers) ListObjects(r *http.Request, args *ListObjectsArgs, r
nextMarker := ""
// Fetch all the objects
for {
lo, err := listObjects(ctx, args.BucketName, args.Prefix, nextMarker, SlashSeparator, 1000)
lo, err := listObjects(ctx, args.BucketName, args.Prefix, nextMarker, SlashSeparator, maxObjectList)
if err != nil {
return &json2.Error{Message: err.Error()}
}
@ -711,7 +712,7 @@ next:
marker := ""
for {
var lo ListObjectsInfo
lo, err = listObjects(ctx, args.BucketName, objectName, marker, "", 1000)
lo, err = listObjects(ctx, args.BucketName, objectName, marker, "", maxObjectList)
if err != nil {
break next
}
@ -1363,7 +1364,8 @@ func (web *webAPIHandlers) DownloadZip(w http.ResponseWriter, r *http.Request) {
// date to the response writer.
marker := ""
for {
lo, err := listObjects(ctx, args.BucketName, pathJoin(args.Prefix, object), marker, "", 1000)
lo, err := listObjects(ctx, args.BucketName, pathJoin(args.Prefix, object), marker, "",
maxObjectList)
if err != nil {
return
}

View File

@ -1620,7 +1620,7 @@ func (s *xlSets) HealObjects(ctx context.Context, bucket, prefix string, healObj
}
}
res, err := s.ListObjectsHeal(ctx, bucket, prefix, marker, "", 1000)
res, err := s.ListObjectsHeal(ctx, bucket, prefix, marker, "", maxObjectList)
if err != nil {
continue
}