mirror of
https://github.com/minio/minio.git
synced 2025-11-20 01:50:24 -05:00
Use rate.Limiter for bandwidth monitoring (#12506)
Bonus: fixes a hang when bandwidth caps are enabled for synchronous replication
This commit is contained in:
committed by
GitHub
parent
8d1bc65757
commit
d00783c923
10
cmd/utils.go
10
cmd/utils.go
@@ -930,3 +930,13 @@ func loadAndResetRPCNetworkErrsCounter() uint64 {
|
||||
defer rest.ResetNetworkErrsCounter()
|
||||
return rest.GetNetworkErrsCounter()
|
||||
}
|
||||
|
||||
// Helper method to return total number of nodes in cluster
|
||||
func totalNodeCount() uint64 {
|
||||
peers, _ := globalEndpoints.peers()
|
||||
totalNodesCount := uint64(len(peers))
|
||||
if totalNodesCount == 0 {
|
||||
totalNodesCount = 1 // For standalone erasure coding
|
||||
}
|
||||
return totalNodesCount
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user