Skip to content

Commit

Permalink
Extend timeout if candidate port is lost in any case
Browse files Browse the repository at this point in the history
Even if `waitForUploadPort` is true, we should extend the timeout to
allow USB enumeration to complete. In this case we extend by only 1
second instead of 5.
  • Loading branch information
cmaglie committed Aug 31, 2023
1 parent b4c02b9 commit 7c77ed2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions commands/upload/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,9 @@ func detectUploadPort(
waitForUploadPort = true
timeout = time.After(5 * time.Second)
log.Debug("User-specified port has been disconnected, now waiting for upload port, timeout extended by 5 seconds")
} else {
timeout = time.After(time.Second)
log.Debug("Candidate port has been disconnected, timeout extended by 1 second")
}
continue
}
Expand Down

0 comments on commit 7c77ed2

Please sign in to comment.