mirror of
https://github.com/minio/minio.git
synced 2025-03-30 17:23:42 -04:00
fix: avoid divide by zero error single node distributed setup (#10862)
This commit is contained in:
parent
8e8ddf7233
commit
8df6112204
@ -237,6 +237,9 @@ func replicateObject(ctx context.Context, objInfo ObjectInfo, objectAPI ObjectLa
|
|||||||
// Setup bandwidth throttling
|
// Setup bandwidth throttling
|
||||||
peers, _ := globalEndpoints.peers()
|
peers, _ := globalEndpoints.peers()
|
||||||
totalNodesCount := len(peers)
|
totalNodesCount := len(peers)
|
||||||
|
if totalNodesCount == 0 {
|
||||||
|
totalNodesCount = 1 // For standalone erasure coding
|
||||||
|
}
|
||||||
b := target.BandwidthLimit / int64(totalNodesCount)
|
b := target.BandwidthLimit / int64(totalNodesCount)
|
||||||
var headerSize int
|
var headerSize int
|
||||||
for k, v := range putOpts.Header() {
|
for k, v := range putOpts.Header() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user