From a758cb41ca6f6a7525d1b83b05831b70b2c8ace8 Mon Sep 17 00:00:00 2001 From: phaer Date: Thu, 26 Oct 2023 10:17:49 +0200 Subject: [PATCH] fix: also set repos if not cached --- buildbot_nix/github_projects.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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]