move object channel defer close to goroutine

Signed-off-by: Brian Downs <brian.downs@gmail.com>
This commit is contained in:
Brian Downs
2021-05-18 19:58:30 -07:00
parent 5bf4d9f687
commit ecbf17e2ed

View File

@@ -1017,12 +1017,13 @@ func (e *ETCD) DeleteSnapshots(ctx context.Context, snapshots []string) error {
}
objectsCh := make(chan minio.ObjectInfo)
defer close(objectsCh)
ctx, cancel := context.WithTimeout(ctx, defaultS3OpTimeout)
defer cancel()
go func() {
defer close(objectsCh)
opts := minio.ListObjectsOptions{
Recursive: true,
}