github: try as few API calls as possible

This commit is contained in:
lilydjwg 2019-03-06 22:37:18 +08:00
parent c23ef737d4
commit ca68c44201
3 changed files with 4 additions and 4 deletions

View File

@ -292,7 +292,7 @@ use_max_tag
``sort_version_key`` option.
max_page
How many pages do we search for the max tag? Default is 3. This works when
How many pages do we search for the max tag? Default is 1. This works when
``use_max_tag`` is set.
proxy

View File

@ -62,7 +62,7 @@ async def get_version_real(name, conf, **kwargs):
return await max_tag(partial(
session.get, headers=headers, **kwargs),
url, name, ignored_tags, include_tags_pattern,
max_page = conf.get("max_page", 3),
max_page = conf.get("max_page", 1),
)
async with session.get(url, headers=headers, **kwargs) as res:

View File

@ -44,6 +44,6 @@ async def test_github_max_tag_with_include(get_version):
version = await get_version("example", {
"github": "EFForg/https-everywhere",
"use_max_tag": 1,
"include_regex": r"^\d.*",
"include_regex": r"chrome-\d.*",
})
assert re.match(r'[\d.]+', version)
assert re.match(r'chrome-[\d.]+', version)