fix: avoid divide by zero error single node distributed setup (#10862)

master
Harshavardhana 4 years ago committed by GitHub
parent 8e8ddf7233
commit 8df6112204
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      cmd/bucket-replication.go

@ -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…
Cancel
Save