Skip to content

Commit

Permalink
Alter our counting to always use maxPageSize as the increment.
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Park committed Nov 10, 2021
1 parent 5e6f237 commit 798aecf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions sdk/messaging/azservicebus/admin/admin_client_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ func (p *queueRuntimePropertiesPager) Err() error {

type queueFeedPagerFunc func(ctx context.Context) (*atom.QueueFeed, *http.Response, error)

func (ac *Client) getQueuePager(maxPageSize int32, skip int) queueFeedPagerFunc {
func (ac *Client) getQueuePager(maxPageSize int32, skip int32) queueFeedPagerFunc {
return func(ctx context.Context) (*atom.QueueFeed, *http.Response, error) {
url := "/$Resources/Queues?"
if maxPageSize > 0 {
Expand All @@ -505,7 +505,7 @@ func (ac *Client) getQueuePager(maxPageSize int32, skip int) queueFeedPagerFunc
return nil, nil, nil
}

skip += len(atomResp.Entries)
skip += maxPageSize
return atomResp, resp, nil
}
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/messaging/azservicebus/admin/admin_client_subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ func (p *subscriptionRuntimePropertiesPager) getNextPage(ctx context.Context) (*

type subscriptionFeedPagerFunc func(ctx context.Context) (*atom.SubscriptionFeed, *http.Response, error)

func (ac *Client) getSubscriptionPager(topicName string, maxPageSize int32, skip int) subscriptionFeedPagerFunc {
func (ac *Client) getSubscriptionPager(topicName string, maxPageSize int32, skip int32) subscriptionFeedPagerFunc {
return func(ctx context.Context) (*atom.SubscriptionFeed, *http.Response, error) {
url := fmt.Sprintf("/%s/Subscriptions?", topicName)
if maxPageSize > 0 {
Expand All @@ -555,7 +555,7 @@ func (ac *Client) getSubscriptionPager(topicName string, maxPageSize int32, skip
return nil, nil, err
}

skip += len(atomResp.Entries)
skip += maxPageSize
return atomResp, resp, nil
}
}
2 changes: 1 addition & 1 deletion sdk/messaging/azservicebus/admin/admin_client_topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ func (ac *Client) getTopicPager(maxPageSize int32, skip int32) topicFeedPagerFun
return nil, nil, nil
}

skip += int32(len(atomResp.Entries))
skip += maxPageSize
return atomResp, resp, nil
}
}
Expand Down

0 comments on commit 798aecf

Please sign in to comment.