forked from TrueCloudLab/frostfs-http-gw
app: use 1 for weight if not specified or wrong
If we have a number of nodes with unspecified weights they'd all be treated equal which seems to be fair.
This commit is contained in:
parent
f019c97ce8
commit
a6f63c2bac
2 changed files with 4 additions and 1 deletions
3
app.go
3
app.go
|
@ -108,6 +108,9 @@ func newApp(ctx context.Context, opt ...Option) App {
|
|||
if address == "" {
|
||||
break
|
||||
}
|
||||
if weight <= 0 { // unspecified or wrong
|
||||
weight = 1
|
||||
}
|
||||
pb.AddNode(address, weight)
|
||||
a.log.Info("add connection", zap.String("address", address), zap.Float64("weight", weight))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue