fs: Return faster on no ListObjects results (#12525)

When no results are sent `result.end` is never sent, so the list becomes hot until the list is full.

Break immediately when channel is closed.

Fixes #12518
This commit is contained in:
Klaus Post 2021-06-17 08:16:31 -07:00 committed by GitHub
parent e4fbc6a9ff
commit ef99438695
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,7 @@ import (
"strings"
"sync"
humanize "github.com/dustin/go-humanize"
"github.com/dustin/go-humanize"
"github.com/minio/minio/internal/sync/errgroup"
)
@ -289,6 +289,7 @@ func listObjects(ctx context.Context, obj ObjectLayer, bucket, prefix, marker, d
if !ok {
// Closed channel.
eof = true
break
}
if HasSuffix(walkResult.entry, SlashSeparator) {