Skip to content

Commit

Permalink
Fixes returnlimit for releases
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Sep 21, 2019
1 parent 6ea4827 commit 73fde96
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions aiogithubapi/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ async def get_rendered_contents(self, path, ref=None):
@backoff.on_exception(
backoff.expo, (ClientError, CancelledError, TimeoutError, KeyError), max_tries=5
)
async def get_releases(self, prerelease=False):
async def get_releases(self, prerelease=False, returnlimit=5):
"""Retrun a list of repository release objects."""
endpoint = "/repos/{}/releases".format(self.full_name)
url = BASE_URL + endpoint
Expand All @@ -160,7 +160,7 @@ async def get_releases(self, prerelease=False):
contents = []

for content in response:
if len(contents) == 5:
if len(contents) == returnlimit:
break
if not prerelease:
if content.get("prerelease", False):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setuptools.setup(
name="aiogithubapi",
version="0.4.1",
version="0.4.2",
author="Joakim Sorensen (@ludeeus)",
author_email="hi@ludeeus.dev",
description="Python async client for the GitHub API.",
Expand Down

0 comments on commit 73fde96

Please sign in to comment.