From 0c8591064dec9ed95d7fba10a9decb5fff1ee605 Mon Sep 17 00:00:00 2001 From: Caleb Brose <5447118+cmbrose@users.noreply.github.com> Date: Mon, 13 Jan 2025 22:09:11 +0000 Subject: [PATCH] Change back to exponential backoff --- internal/codespaces/codespaces.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/codespaces/codespaces.go b/internal/codespaces/codespaces.go index 38a2e903e..92185120a 100644 --- a/internal/codespaces/codespaces.go +++ b/internal/codespaces/codespaces.go @@ -15,7 +15,12 @@ import ( // codespaceStatePollingBackoff is the delay between state polls while waiting for codespaces to become // available. It's only exposed so that it can be shortened for testing, otherwise it should not be changed -var codespaceStatePollingBackoff = backoff.NewConstantBackOff(10 * time.Second) +var codespaceStatePollingBackoff backoff.BackOff = backoff.NewExponentialBackOff( + backoff.WithInitialInterval(1*time.Second), + backoff.WithMultiplier(1.02), + backoff.WithMaxInterval(10*time.Second), + backoff.WithMaxElapsedTime(5*time.Minute), +) func connectionReady(codespace *api.Codespace) bool { // If the codespace is not available, it is not ready