diff --git a/buildbot_nix/github_projects.py b/buildbot_nix/github_projects.py index 9f7756d..fb8f4b0 100644 --- a/buildbot_nix/github_projects.py +++ b/buildbot_nix/github_projects.py @@ -148,9 +148,8 @@ def refresh_projects(github_token: str, repo_cache_file: Path) -> None: def load_projects(github_token: str, repo_cache_file: Path) -> list[GithubProject]: - if repo_cache_file.exists(): - log.msg("fetching github repositories from cache") - repos: list[dict[str, Any]] = json.loads(repo_cache_file.read_text()) - else: + if not repo_cache_file.exists(): + log.msg("fetching github repositories") refresh_projects(github_token, repo_cache_file) + repos: list[dict[str, Any]] = json.loads(repo_cache_file.read_text()) return [GithubProject(repo) for repo in repos]