Skip to content

Commit

Permalink
chore: add comment about check and output
Browse files Browse the repository at this point in the history
  • Loading branch information
2color committed Aug 2, 2024
1 parent 1600306 commit 2c70793
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@ func (d *daemon) runCheck(query url.Values) (*output, error) {

if !connectionFailed {
// Is the target connectable
dialCtx, dialCancel := context.WithTimeout(ctx, time.Second*3)
dialCtx, dialCancel := context.WithTimeout(ctx, time.Second*6)
connErr := testHost.Connect(dialCtx, *ai)
// Testing shows that it's pretty common for Connect to succeeed but for NewStream to fail.
// This causes the output to be confusing, because ConnectionError is an empty string
dialCancel()
if connErr != nil {
out.ConnectionError = fmt.Sprintf("error dialing to peer: %s", connErr.Error())
Expand Down

0 comments on commit 2c70793

Please sign in to comment.