From e8c6d0b42d8b4040afce378851057eaedc84705f Mon Sep 17 00:00:00 2001 From: "Marcel S. Henselin" Date: Fri, 13 Mar 2026 20:13:24 +0100 Subject: [PATCH] fix: random sleep timer on retry [skip ci] --- stackit/internal/wait/postgresflexalpha/wait.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stackit/internal/wait/postgresflexalpha/wait.go b/stackit/internal/wait/postgresflexalpha/wait.go index c40b26af..976a3260 100644 --- a/stackit/internal/wait/postgresflexalpha/wait.go +++ b/stackit/internal/wait/postgresflexalpha/wait.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "math" + "math/rand/v2" "net/http" "time" @@ -141,7 +142,7 @@ func CreateInstanceWaitHandler( "failedCount": failedCount, }, ) - time.Sleep(5 * time.Second) + time.Sleep(time.Duration(rand.IntN(120)) * time.Second) //nolint:gosec // not that important and temporary return false, nil, nil } return true, s, fmt.Errorf( @@ -217,7 +218,7 @@ func PartialUpdateInstanceWaitHandler( "failedCount": failedCount, }, ) - time.Sleep(5 * time.Second) + time.Sleep(time.Duration(rand.IntN(120)) * time.Second) //nolint:gosec // not that important and temporary return false, nil, nil } return true, s, fmt.Errorf(