Skip to content

Retry transient Codeforces API failures; fix README OAuth advice#1

Open
OmarMusayev wants to merge 1 commit into
mainfrom
harden-fetcher
Open

Retry transient Codeforces API failures; fix README OAuth advice#1
OmarMusayev wants to merge 1 commit into
mainfrom
harden-fetcher

Conversation

@OmarMusayev
Copy link
Copy Markdown
Owner

Why

Two failure modes hit the workflow today:

  1. Outbox auth — the Google OAuth refresh token expired. The consent screen was in "Testing" status, where Google expires refresh tokens after 7 days. (Already resolved out-of-band: token re-minted, all three repo secrets re-synced to the live OAuth client.)
  2. Fetch step — a single Codeforces API read-timeout failed the entire scheduled run, because cf_get() had no retry logic.

Changes

  • fetch_data.pycf_get() retries transient failures (read timeouts, connection errors, non-OK CF responses): 4 attempts, 3s/8s/20s backoff. Worst-case added wait ~31s, well under the 10-minute job timeout.
  • README.md — the setup step no longer says the OAuth app can stay in "Testing"; it now says to publish the app, and notes the 7-day refresh-token expiry that "Testing" causes.

Test

  • python -m py_compile fetch_data.py — clean
  • import fetch_data — clean (RETRIES / RETRY_BACKOFF resolve)

🤖 Generated with Claude Code

…vice

cf_get() now retries transient failures - read timeouts, connection
errors, and non-OK Codeforces responses - for 4 attempts with 3s/8s/20s
backoff. Previously a single Codeforces API blip failed the whole
scheduled run; one such read-timeout did exactly that today.

README: the OAuth setup step said the consent screen "can stay in
Testing status". That makes Google expire the refresh token after 7
days, which silently breaks send_outbox.py. It now says to publish
the app.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant