From 088773d213c90d2d47446ac45571a320fe291a47 Mon Sep 17 00:00:00 2001 From: pommee Date: Fri, 7 Jun 2024 00:01:28 +0200 Subject: [PATCH] fix: increase git fetch time, prevent rate limit --- application/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/main.py b/application/main.py index 2720f09..86500d4 100644 --- a/application/main.py +++ b/application/main.py @@ -325,7 +325,7 @@ def on_mount(self) -> None: if parse(last_fetch.version_fetched) > current_version: # Fetch latest version if more than 20 minutes ago. - if time_since_last_fetch() > 0.1: + if time_since_last_fetch() > 20: latest_version = get_latest_version() if latest_version is not None: if latest_version > current_version: @@ -437,7 +437,7 @@ def update(force): current_version = parse(get_current_version()) latest_version = None - if time_since_last_fetch() < 0.1 and not force: + if time_since_last_fetch() < 5 and not force: print( f"⚠️ {Fore.YELLOW}Updating too often might lead to being rate-limited.{Style.RESET_ALL}\n" "Pass --force or -f to force update."