From 47824c5711d0f65a844e98165726c045d17d6482 Mon Sep 17 00:00:00 2001 From: Thomas SharedInbox Date: Sat, 23 May 2026 14:13:14 +0200 Subject: [PATCH] Handle transient git fetch failures gracefully Exit cleanly instead of crashing so the next cron run retries. Co-Authored-By: Claude Sonnet 4.6 --- deploy_cron.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deploy_cron.py b/deploy_cron.py index 1c50c91..8d8cf5e 100644 --- a/deploy_cron.py +++ b/deploy_cron.py @@ -97,7 +97,11 @@ Push a fix to `main` — the cron (every 5 min) will retry automatically on the def main(): - git('fetch', 'origin', 'main') + try: + git('fetch', 'origin', 'main') + except subprocess.CalledProcessError as exc: + print(f'git fetch failed (transient?): {exc} — skipping this run.', file=sys.stderr) + return remote_sha = git('rev-parse', 'origin/main') last_sha = read(SHA_FILE)