From d8028374c2c2b682ae4e2a0ca8eb13163f3e6a52 Mon Sep 17 00:00:00 2001 From: xinau Date: Wed, 9 Dec 2020 08:18:46 +0100 Subject: [PATCH] internal/discovery: fixing broken retry-after duration test case Signed-off-by: xinau --- internal/discovery/client/client.go | 2 +- internal/discovery/client/client_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/discovery/client/client.go b/internal/discovery/client/client.go index 530e410..767308f 100644 --- a/internal/discovery/client/client.go +++ b/internal/discovery/client/client.go @@ -153,5 +153,5 @@ func GetRetryAfter(resp *http.Response) (time.Duration, bool) { if err != nil { return 0, false } - return time.Second * time.Duration(after + 1), true + return time.Second * time.Duration(after+1), true } diff --git a/internal/discovery/client/client_test.go b/internal/discovery/client/client_test.go index 83244e6..9a62888 100644 --- a/internal/discovery/client/client_test.go +++ b/internal/discovery/client/client_test.go @@ -189,7 +189,7 @@ func TestGetRetryAfter(t *testing.T) { &http.Response{Header: map[string][]string{ "Retry-After": []string{"3600"}, }}, - time.Second * 3600, true, + time.Second * 3601, true, }, "malformed header": { &http.Response{Header: map[string][]string{ "Retry-After": []string{"malformed"},