Skip to content

Commit 7c77ed2

Browse files
committed
Extend timeout if candidate port is lost in any case
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.
1 parent b4c02b9 commit 7c77ed2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: commands/upload/upload.go

+3
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,9 @@ func detectUploadPort(
575575
waitForUploadPort = true
576576
timeout = time.After(5 * time.Second)
577577
log.Debug("User-specified port has been disconnected, now waiting for upload port, timeout extended by 5 seconds")
578+
} else {
579+
timeout = time.After(time.Second)
580+
log.Debug("Candidate port has been disconnected, timeout extended by 1 second")
578581
}
579582
continue
580583
}

0 commit comments

Comments
 (0)