From b2b361e7fd67df13f55460b2de8ec40072cb5d9c Mon Sep 17 00:00:00 2001 From: ziyeqf <51212351+ziyeqf@users.noreply.github.com> Date: Fri, 18 Oct 2024 15:39:38 +0800 Subject: [PATCH 1/2] supress empty string nextlink url --- sdk/client/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/client/client.go b/sdk/client/client.go index 6429116fecf..fa2ce908e49 100644 --- a/sdk/client/client.go +++ b/sdk/client/client.go @@ -615,7 +615,7 @@ func (c *Client) ExecutePaged(ctx context.Context, req *Request) (*Response, err return resp, err } } - if nextLink == nil { + if nextLink == nil || string(*nextLink) == "" { // This is the last page return resp, nil } @@ -699,7 +699,7 @@ func (c *Client) retryableClient(ctx context.Context, checkRetry retryablehttp.C // This results into the following N(t) (by guaranteeing T(n) <= t): // - n = floor(log(t+1)) - 1 (0<=t<=63) // - n = (t - 63)/61 + 6 (t > 63) - var safeRetryNumber = func(t time.Duration) int { + safeRetryNumber := func(t time.Duration) int { sec := t.Seconds() if sec <= 63 { return int(math.Floor(math.Log2(sec+1))) - 1 From a8eb029a5b43fa012697cb3484fc7952b51462dc Mon Sep 17 00:00:00 2001 From: ziyeqf <51212351+ziyeqf@users.noreply.github.com> Date: Fri, 18 Oct 2024 15:45:17 +0800 Subject: [PATCH 2/2] revert non-related change --- sdk/client/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/client/client.go b/sdk/client/client.go index fa2ce908e49..9de6d06ee4c 100644 --- a/sdk/client/client.go +++ b/sdk/client/client.go @@ -699,7 +699,7 @@ func (c *Client) retryableClient(ctx context.Context, checkRetry retryablehttp.C // This results into the following N(t) (by guaranteeing T(n) <= t): // - n = floor(log(t+1)) - 1 (0<=t<=63) // - n = (t - 63)/61 + 6 (t > 63) - safeRetryNumber := func(t time.Duration) int { + var safeRetryNumber = func(t time.Duration) int { sec := t.Seconds() if sec <= 63 { return int(math.Floor(math.Log2(sec+1))) - 1