Skip to content

Commit 3828382

Browse files
author
Ben Lamothe
authored
Merge pull request #440 from quorumcontrol/feature/no-bootstrap-log-error
have bootstrap purge its subscription to avoid 'too slow' logs
2 parents c80032f + c44aece commit 3828382

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

nodebuilder/nodebuilder.go

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,36 @@ func (nb *NodeBuilder) startBootstrap(ctx context.Context) (*p2p.LibP2PHost, err
257257
if err != nil {
258258
return host, fmt.Errorf("error getting notary group %w", err)
259259
}
260-
_, err = host.GetPubSub().Subscribe(group.Config().TransactionTopic)
260+
transSub, err := host.GetPubSub().Subscribe(group.Config().TransactionTopic)
261261
if err != nil {
262262
return host, fmt.Errorf("error subscribing %w", err)
263263
}
264-
_, err = host.GetPubSub().Subscribe(group.ID)
264+
265+
go func() {
266+
for {
267+
_, err := transSub.Next(ctx)
268+
if err != nil {
269+
logger.Warningf("error getting sub %v", err)
270+
return
271+
}
272+
}
273+
}()
274+
275+
commitSub, err := host.GetPubSub().Subscribe(group.ID)
265276
if err != nil {
266277
return host, fmt.Errorf("error subscribing %w", err)
267278
}
279+
280+
go func() {
281+
for {
282+
_, err := commitSub.Next(ctx)
283+
if err != nil {
284+
logger.Warningf("error getting sub %v", err)
285+
return
286+
}
287+
}
288+
}()
289+
268290
return host, nil
269291
}
270292

0 commit comments

Comments
 (0)