File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -86,12 +86,10 @@ func (pm *PeerManager) updateLoop(ctx irrecoverable.SignalerContext) {
86
86
func (pm * PeerManager ) periodicLoop (ctx irrecoverable.SignalerContext ) {
87
87
// add a random delay to initial launch to avoid synchronizing this
88
88
// potentially expensive operation across the network
89
- r , _ := rand .Uint64n (uint64 (pm .peerUpdateInterval .Nanoseconds ()))
90
- // ignore the error here, if randomness fails `r` would be zero and there will be no delay
91
- // for the current node
92
- // TODO: treat the error properly instead of swallowing it. In this specific case, `utils/rand`
93
- // only errors if there is a randomness system issue. Such issue will cause errors in many
94
- // other components.
89
+ r , err := rand .Uint64n (uint64 (pm .peerUpdateInterval .Nanoseconds ()))
90
+ if err != nil {
91
+ ctx .Throw (fmt .Errorf ("unable to generate random interval: %w" , err ))
92
+ }
95
93
delay := time .Duration (r )
96
94
97
95
ticker := time .NewTicker (pm .peerUpdateInterval )
You can’t perform that action at this time.
0 commit comments