Skip to content

Commit 9d4d4fb

Browse files
committed
Revert "feat(BRIDGE-586): add retry-condition for refresh failed"
This reverts commit 0f1b604.
1 parent 8a8be48 commit 9d4d4fb

3 files changed

Lines changed: 0 additions & 56 deletions

File tree

manager_builder.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ func (builder *managerBuilder) build() *Manager {
9090
m.rc.AddRetryCondition(catchTooManyRequests)
9191
m.rc.AddRetryCondition(catchDialError)
9292
m.rc.AddRetryCondition(catchDropError)
93-
m.rc.AddRetryCondition(retryRefreshFailed)
9493
m.rc.SetRetryAfter(catchRetryAfter)
9594

9695
// Set the data type of API errors.

response.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"net"
1010
"net/http"
1111
"strconv"
12-
"strings"
1312
"time"
1413

1514
"github.com/ProtonMail/gopenpgp/v2/crypto"
@@ -170,18 +169,6 @@ func catchRetryAfter(_ *resty.Client, res *resty.Response) (time.Duration, error
170169
return time.Duration(after) * time.Second, nil
171170
}
172171

173-
func retryRefreshFailed(res *resty.Response, err error) bool {
174-
if err == nil || res == nil || res.Request == nil {
175-
return false
176-
}
177-
178-
if !strings.HasSuffix(res.Request.URL, "/auth/v4/refresh") {
179-
return false
180-
}
181-
182-
return res.RawResponse == nil || res.StatusCode() == http.StatusBadRequest || res.StatusCode() == http.StatusUnprocessableEntity
183-
}
184-
185172
func catchTooManyRequests(res *resty.Response, _ error) bool {
186173
return res.StatusCode() == http.StatusTooManyRequests || res.StatusCode() == http.StatusServiceUnavailable
187174
}

response_retry_test.go

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)