refactor: run initial peer connect async
This commit is contained in:
parent
6591b2a79f
commit
123f28ac19
|
@ -78,10 +78,14 @@ func (p *P2PImpl) Start() error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = p.ConnectToNode([]*url.URL{u}, false)
|
|
||||||
|
peer := peer
|
||||||
|
go func() {
|
||||||
|
err := p.ConnectToNode([]*url.URL{u}, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
p.logger.Error("failed to connect to initial peer", zap.Error(err), zap.String("peer", peer))
|
||||||
}
|
}
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue