fix: random sleep timer on retry
[skip ci]
This commit is contained in:
parent
50ef0c841b
commit
e8c6d0b42d
1 changed files with 3 additions and 2 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue