mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
allow resultCh to be closed() after clusterMetaHealthInfo() (#16073)
This commit is contained in:
parent
4c9cac0b47
commit
3597af789e
@ -2613,7 +2613,10 @@ func getClusterMetaInfo(ctx context.Context) []byte {
|
|||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
resultCh := make(chan madmin.ClusterRegistrationInfo)
|
resultCh := make(chan madmin.ClusterRegistrationInfo)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
|
defer close(resultCh)
|
||||||
|
|
||||||
ci := madmin.ClusterRegistrationInfo{}
|
ci := madmin.ClusterRegistrationInfo{}
|
||||||
ci.Info.NoOfServerPools = len(globalEndpoints)
|
ci.Info.NoOfServerPools = len(globalEndpoints)
|
||||||
ci.Info.NoOfServers = len(globalEndpoints.Hostnames())
|
ci.Info.NoOfServers = len(globalEndpoints.Hostnames())
|
||||||
@ -2635,7 +2638,12 @@ func getClusterMetaInfo(ctx context.Context) []byte {
|
|||||||
|
|
||||||
ci.DeploymentID = globalDeploymentID
|
ci.DeploymentID = globalDeploymentID
|
||||||
ci.ClusterName = fmt.Sprintf("%d-servers-%d-disks-%s", ci.Info.NoOfServers, ci.Info.NoOfDrives, ci.Info.MinioVersion)
|
ci.ClusterName = fmt.Sprintf("%d-servers-%d-disks-%s", ci.Info.NoOfServers, ci.Info.NoOfDrives, ci.Info.MinioVersion)
|
||||||
resultCh <- ci
|
|
||||||
|
select {
|
||||||
|
case resultCh <- ci:
|
||||||
|
case <-ctx.Done():
|
||||||
|
return
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
select {
|
select {
|
||||||
|
Loading…
Reference in New Issue
Block a user