Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support For Limiting Auto-Pagination Depth #150

Open
tyler-domitrovich opened this issue Jul 16, 2021 · 5 comments
Open

Support For Limiting Auto-Pagination Depth #150

tyler-domitrovich opened this issue Jul 16, 2021 · 5 comments

Comments

@tyler-domitrovich
Copy link

It would be nice to be able to limit how many pages of results are returned. Consider the case where we want to retrieve the most recent 20 commits for the main branch of a very active repository. Currently, the auto-pagination will recurse through all pages of results which is time consuming and unnecessary since we would have all of the results we require for this example after the first couple of pages.

@tyler-domitrovich
Copy link
Author

tyler-domitrovich commented Jul 16, 2021

FYI I was able to get a rough pass of this behavior working in my fork here:

https://github.com/tyler-domitrovich/go-bitbucket/tree/adjustable-pagination-depth

If you have any interest in this feature let me know and I will create a PR!

@ktrysmt
Copy link
Owner

ktrysmt commented Jul 19, 2021

Umm.. DEFAULT_PAGE_LENGTH is not enough?

https://github.com/ktrysmt/go-bitbucket/blob/master/client.go#L24

@tyler-domitrovich
Copy link
Author

I don't believe so. It looks like DEFAULT_PAGE_LENGTH is used to set pagelen, which does allow us to change the number of results returned per page, but does not allow us to change the number of pages returned so we still will recurse through every page of results available.

@ktrysmt
Copy link
Owner

ktrysmt commented Jul 20, 2021

Certainly. If you have a large number of pages, it may be important to limit the number of pages.
By the way, POC smells a little buggy. I think we can make the changes a little smaller.

@Zermond
Copy link
Contributor

Zermond commented May 12, 2022

Certainly. If you have a large number of pages, it may be important to limit the number of pages. By the way, POC smells a little buggy. I think we can make the changes a little smaller.

Hello!

Maybe we can be use my PR for this issue?

it small and won't break the old code

#199

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants