mirror of
https://github.com/pgsty/minio.git
synced 2026-07-24 14:36:15 +03:00
fix: avoid divide by zero error single node distributed setup (#10862)
This commit is contained in:
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user