Skip to content

Commit

Permalink
fetch: move some blocking parsing into threads
Browse files Browse the repository at this point in the history
  • Loading branch information
lazka committed Jan 12, 2024
1 parent 915771d commit 7d7653a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ async def update_cygwin_versions() -> None:
logger.info("Loading %r" % url)
data = await get_content_cached(url, timeout=REQUEST_TIMEOUT)
data = zstandard.ZstdDecompressor().decompress(data)
cygwin_versions, cygwin_versions_mingw64 = parse_cygwin_versions(url, data)
cygwin_versions, cygwin_versions_mingw64 = await asyncio.to_thread(parse_cygwin_versions, url, data)
state.set_ext_infos(ExtId("cygwin", "Cygwin", True), cygwin_versions)
state.set_ext_infos(ExtId("cygwin-mingw64", "Cygwin-mingw64", False), cygwin_versions_mingw64)

Expand All @@ -144,7 +144,7 @@ async def update_gentoo_versions() -> None:
logger.info("update gentoo info")
logger.info("Loading %r" % url)
data = await get_content_cached(url, timeout=REQUEST_TIMEOUT)
gentoo_versions = parse_gentoo_versions(data)
gentoo_versions = await asyncio.to_thread(parse_gentoo_versions, data)
# fallback, since parsing isn't perfect and we include unstable versions
state.set_ext_infos(ExtId("gentoo", "Gentoo", True), gentoo_versions)

Expand Down

0 comments on commit 7d7653a

Please sign in to comment.