Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

get_pushes() doesn't stop automatically after getting all possible pushes #88

Open
andrewjbennett opened this issue Jul 25, 2016 · 2 comments

Comments

@andrewjbennett
Copy link

It just checks it has a "cursor" field, but it seems to have this even when it's reached the last page of pushes. This eats through rate limit very very quickly.

I'll send a pull request with a patch within the next few days hopefully.

@ghost
Copy link

ghost commented Dec 9, 2016

@andrewjbennett did you ever fix this?

@IamTheCarl
Copy link

I've found a reasonable workaround is to use the modified_after and limit variables.

def grab_pushes(limit=10):
    print("Fetching pushes.")

    global last_check

    pushes = pb.get_pushes(modified_after=last_check, limit=limit)
    last_check = time.time()

    for push in pushes:
        # Process pushes.

    print("Done.")

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

No branches or pull requests

2 participants