From 7c77ed242383e416ff8748884a64474f73932911 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 31 Aug 2023 10:45:02 +0200 Subject: [PATCH] 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. --- commands/upload/upload.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/commands/upload/upload.go b/commands/upload/upload.go index 5fe21089848..bc7aafe2067 100644 --- a/commands/upload/upload.go +++ b/commands/upload/upload.go @@ -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 }