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

Fix resource pagination #9

Open
lamenezes opened this issue Oct 15, 2017 · 0 comments
Open

Fix resource pagination #9

lamenezes opened this issue Oct 15, 2017 · 0 comments

Comments

@lamenezes
Copy link
Contributor

Currently listing events or issues that surpasses the page limit leads to an infinite loop. That's because the "next" page never is accessed only the first one. This is showed below:

    events = self.api.project_events.list(organization, project)
    all_events.extend(events.body)

    links = parse_header_links(events.headers.get('Link'))
    while links[1]['results'] == 'true':
        events = self.api.project_events.list(organization, project)  # same page is accessed
        all_events.extend(events.body)
        # links is never updated
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

1 participant