Skip to content

Commit

Permalink
Fix false fatal err while reading peers in config (#19)
Browse files Browse the repository at this point in the history
Earlier we didn't differ is variable empty or just not set, that's why
when we met empty address we just finished reading of the list of peers
and printed "skip, empty address" anyway:
```
if address == "" {
	a.log.Warn("skip, empty address")
	break
}
```

Changes in the last commit added check if `peers.i.address` is empty and
if true, raise fatal. It led to false error when the list of peers is
over.
  • Loading branch information
roman-khimov authored Mar 21, 2023
2 parents 3f8926c + 2aa2bb9 commit e8f759c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/neofs-send-authz/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ func (a *app) initPool(ctx context.Context, key *keys.PrivateKey) {
p.SetClientRebalanceInterval(rebalanceInterval)

for i := 0; ; i++ {
key := cfgPeers + "." + strconv.Itoa(i) + "."
key := cfgPeers + "." + strconv.Itoa(i)
if !a.cfg.IsSet(key) {
break
}
key += "."
address := a.cfg.GetString(key + "address")
weight := a.cfg.GetFloat64(key + "weight")
priority := a.cfg.GetInt(key + "priority")
Expand Down

0 comments on commit e8f759c

Please sign in to comment.