mirror of https://github.com/status-im/go-waku.git
fix: use 5s timeout in discv5 iterator
This commit is contained in:
parent
9b7ad40b06
commit
ac75160817
|
@ -313,12 +313,15 @@ restartLoop:
|
|||
err := d.iterate(ctx)
|
||||
if err != nil {
|
||||
d.log.Debug("iterating discv5", zap.Error(err))
|
||||
time.Sleep(2 * time.Second)
|
||||
}
|
||||
|
||||
t := time.NewTimer(5 * time.Second)
|
||||
select {
|
||||
case <-t.C:
|
||||
t.Stop()
|
||||
case <-ctx.Done():
|
||||
t.Stop()
|
||||
break restartLoop
|
||||
default:
|
||||
}
|
||||
}
|
||||
d.log.Warn("Discv5 loop stopped")
|
||||
|
|
Loading…
Reference in New Issue