mirror of
https://github.com/minio/minio.git
synced 2025-04-01 10:13:42 -04:00
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:
parent
e4fbc6a9ff
commit
ef99438695
@ -22,7 +22,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
humanize "github.com/dustin/go-humanize"
|
"github.com/dustin/go-humanize"
|
||||||
"github.com/minio/minio/internal/sync/errgroup"
|
"github.com/minio/minio/internal/sync/errgroup"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -289,6 +289,7 @@ func listObjects(ctx context.Context, obj ObjectLayer, bucket, prefix, marker, d
|
|||||||
if !ok {
|
if !ok {
|
||||||
// Closed channel.
|
// Closed channel.
|
||||||
eof = true
|
eof = true
|
||||||
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if HasSuffix(walkResult.entry, SlashSeparator) {
|
if HasSuffix(walkResult.entry, SlashSeparator) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user