fix: do not update offlinesession lastUsed field if refresh token was not change
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
This commit is contained in:
@@ -740,13 +740,14 @@ func retryOnConflict(ctx context.Context, action func() error) error {
|
||||
for {
|
||||
select {
|
||||
case <-time.After(getNextStep()):
|
||||
if err := action(); err == nil || !isKubernetesAPIConflictError(err) {
|
||||
err := action()
|
||||
if err == nil || !isKubernetesAPIConflictError(err) {
|
||||
return err
|
||||
}
|
||||
|
||||
attempts++
|
||||
if attempts >= 4 {
|
||||
return errors.New("maximum timeout reached while retrying a conflicted request")
|
||||
return fmt.Errorf("maximum timeout reached while retrying a conflicted request: %w", err)
|
||||
}
|
||||
case <-ctx.Done():
|
||||
return errors.New("canceled")
|
||||
|
@@ -262,7 +262,7 @@ func TestRetryOnConflict(t *testing.T) {
|
||||
{
|
||||
"Timeout reached",
|
||||
func() error { err := httpErr{status: 409}; return error(&err) },
|
||||
"maximum timeout reached while retrying a conflicted request",
|
||||
"maximum timeout reached while retrying a conflicted request: Conflict: response from server \"\"",
|
||||
},
|
||||
{
|
||||
"HTTP Error",
|
||||
|
Reference in New Issue
Block a user