fix: random sleep timer on retry

[skip ci]
This commit is contained in:
Marcel S. Henselin 2026-03-13 20:13:24 +01:00
parent 50ef0c841b
commit e8c6d0b42d

View file

@ -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(