From 70c9e567ca7fe3885a2cdd6e470846cc3960fad7 Mon Sep 17 00:00:00 2001 From: Emil Date: Mon, 3 Aug 2026 14:26:40 +0300 Subject: [PATCH] Probe the busy port with a cancellable request --- coordinator/cmd/worker-agent/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/coordinator/cmd/worker-agent/main.go b/coordinator/cmd/worker-agent/main.go index 7d002d7..9011bb1 100644 --- a/coordinator/cmd/worker-agent/main.go +++ b/coordinator/cmd/worker-agent/main.go @@ -218,7 +218,11 @@ func openBrowser(url string) { func wizardAlreadyRunning(port int) string { url := fmt.Sprintf("http://127.0.0.1:%d/", port) client := http.Client{Timeout: 2 * time.Second} - resp, err := client.Get(url) + req, err := http.NewRequestWithContext(context.Background(), http.MethodGet, url, nil) + if err != nil { + return "" + } + resp, err := client.Do(req) if err != nil { return "" }