mirror of
https://github.com/minio/minio.git
synced 2025-04-01 10:13:42 -04:00
Added 'close' to results channel in Walk() (#9956)
This commit is contained in:
parent
174f428571
commit
648cb13e02
@ -60,6 +60,10 @@ func (l *GatewayLocker) NewNSLock(ctx context.Context, bucket string, objects ..
|
|||||||
func (l *GatewayLocker) Walk(ctx context.Context, bucket, prefix string, results chan<- ObjectInfo) error {
|
func (l *GatewayLocker) Walk(ctx context.Context, bucket, prefix string, results chan<- ObjectInfo) error {
|
||||||
walk := func(ctx context.Context, bucket, prefix string, results chan<- ObjectInfo) error {
|
walk := func(ctx context.Context, bucket, prefix string, results chan<- ObjectInfo) error {
|
||||||
var marker string
|
var marker string
|
||||||
|
|
||||||
|
// Make sure the results channel is ready to be read when we're done.
|
||||||
|
defer close(results)
|
||||||
|
|
||||||
for {
|
for {
|
||||||
// set maxKeys to '0' to list maximum possible objects in single call.
|
// set maxKeys to '0' to list maximum possible objects in single call.
|
||||||
loi, err := l.ObjectLayer.ListObjects(ctx, bucket, prefix, marker, "", 0)
|
loi, err := l.ObjectLayer.ListObjects(ctx, bucket, prefix, marker, "", 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user