This commit is contained in:
doms9 2025-12-06 00:26:59 -05:00
parent a979f0bf75
commit 00000d97a5
8 changed files with 40 additions and 29 deletions

View file

@ -27,8 +27,6 @@ def fix_event(s: str) -> str:
async def refresh_html_cache(
client: httpx.AsyncClient, url: str
) -> dict[str, dict[str, str | float]]:
log.info("Refreshing HTML cache")
try:
r = await client.get(url)
r.raise_for_status()
@ -95,6 +93,8 @@ async def get_events(
now = Time.clean(Time.now())
if not (events := HTML_CACHE.load()):
log.info("Refreshing HTML cache")
tasks = [refresh_html_cache(client, url) for url in BASE_URLS.values()]
results = await asyncio.gather(*tasks)