Update dial timeout
This commit is contained in:
parent
e148577aed
commit
973d55c12b
@ -113,7 +113,7 @@ func (d *dialer) Dial(ctx context.Context, peerId string) (p peer.Peer, err erro
|
|||||||
func (d *dialer) handshake(ctx context.Context, addr, peerId string) (conn drpc.Conn, sc sec.SecureConn, err error) {
|
func (d *dialer) handshake(ctx context.Context, addr, peerId string) (conn drpc.Conn, sc sec.SecureConn, err error) {
|
||||||
st := time.Now()
|
st := time.Now()
|
||||||
// TODO: move dial timeout to config
|
// TODO: move dial timeout to config
|
||||||
tcpConn, err := net.DialTimeout("tcp", addr, time.Second*3)
|
tcpConn, err := net.DialTimeout("tcp", addr, time.Second*15)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, fmt.Errorf("dialTimeout error: %v; since start: %v", err, time.Since(st))
|
return nil, nil, fmt.Errorf("dialTimeout error: %v; since start: %v", err, time.Since(st))
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user