Skip to content

Commit

Permalink
Merge pull request #440 from quorumcontrol/feature/no-bootstrap-log-e…
Browse files Browse the repository at this point in the history
…rror

have bootstrap purge its subscription to avoid 'too slow' logs
  • Loading branch information
Ben Lamothe authored Mar 19, 2020
2 parents c80032f + c44aece commit 3828382
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions nodebuilder/nodebuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,36 @@ func (nb *NodeBuilder) startBootstrap(ctx context.Context) (*p2p.LibP2PHost, err
if err != nil {
return host, fmt.Errorf("error getting notary group %w", err)
}
_, err = host.GetPubSub().Subscribe(group.Config().TransactionTopic)
transSub, err := host.GetPubSub().Subscribe(group.Config().TransactionTopic)
if err != nil {
return host, fmt.Errorf("error subscribing %w", err)
}
_, err = host.GetPubSub().Subscribe(group.ID)

go func() {
for {
_, err := transSub.Next(ctx)
if err != nil {
logger.Warningf("error getting sub %v", err)
return
}
}
}()

commitSub, err := host.GetPubSub().Subscribe(group.ID)
if err != nil {
return host, fmt.Errorf("error subscribing %w", err)
}

go func() {
for {
_, err := commitSub.Next(ctx)
if err != nil {
logger.Warningf("error getting sub %v", err)
return
}
}
}()

return host, nil
}

Expand Down

0 comments on commit 3828382

Please sign in to comment.