diff --git a/README.md b/README.md index 8a394c5..34c04ad 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ HTTP_GW_REQUEST_TIMEOUT=duration - Timeout for request HTTP_GW_REBALANCE_TIMER=duration - Time between connections checks HTTP_GW_LISTEN_ADDRESS=host:port - Address to listen connections HTTP_GW_PEERS__ADDRESS=host:port - Address of NeoFS Node -HTTP_GW_PEERS__WEIGHT=float - Weight of NeoFS Node +HTTP_GW_PEERS__WEIGHT=float - Weight of NeoFS Node (1 if not specified) HTTP_GW_PPROF=bool - Enable/disable pprof (/debug/pprof) HTTP_GW_METRICS=bool - Enable/disable prometheus metrics endpoint (/metrics) HTTP_GW_LOGGER_FORMAT=string - Logger format diff --git a/app.go b/app.go index 1144de0..bafb90c 100644 --- a/app.go +++ b/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)) }