From d65c6ccd6413253cc15643af42e00ee7bf03a4b9 Mon Sep 17 00:00:00 2001 From: Vinta Chen Date: Wed, 18 Mar 2026 22:08:35 +0800 Subject: [PATCH] refactor: rename fetch_stats target and remove cache age gating Rename the Makefile target from fetch_stats to fetch_github_stars to match the script name. Remove CACHE_MAX_AGE_DAYS and the staleness check so every run fetches all repos unconditionally. Co-Authored-By: Claude --- Makefile | 2 +- website/fetch_github_stars.py | 15 ++------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index ba47e1f4..21a4c5d2 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ export install: uv sync -fetch_stats: +fetch_github_stars: uv run python website/fetch_github_stars.py test: diff --git a/website/fetch_github_stars.py b/website/fetch_github_stars.py index 24ae1e9d..152b2c52 100644 --- a/website/fetch_github_stars.py +++ b/website/fetch_github_stars.py @@ -12,7 +12,6 @@ import httpx from build import extract_github_repo, load_stars -CACHE_MAX_AGE_DAYS = 7 DATA_DIR = Path(__file__).parent / "data" CACHE_FILE = DATA_DIR / "github_stars.json" README_PATH = Path(__file__).parent.parent / "README.md" @@ -114,18 +113,8 @@ def main() -> None: print(f"Pruned {len(cache) - len(pruned)} stale cache entries") cache = pruned - # Determine which repos need fetching (missing or stale) - to_fetch = [] - for repo in sorted(current_repos): - entry = cache.get(repo) - if entry and "fetched_at" in entry: - fetched = datetime.fromisoformat(entry["fetched_at"]) - age_days = (now - fetched).days - if age_days < CACHE_MAX_AGE_DAYS: - continue - to_fetch.append(repo) - - print(f"{len(to_fetch)} repos to fetch ({len(current_repos) - len(to_fetch)} cached)") + to_fetch = sorted(current_repos) + print(f"{len(to_fetch)} repos to fetch") if not to_fetch: save_cache(cache)