Skip to content

Retry Garmin stat downloads on transient failures#308

Open
deewhyarc-glitch wants to merge 1 commit intotcgoetz:masterfrom
deewhyarc-glitch:fix/hrv-download-retries
Open

Retry Garmin stat downloads on transient failures#308
deewhyarc-glitch wants to merge 1 commit intotcgoetz:masterfrom
deewhyarc-glitch:fix/hrv-download-retries

Conversation

@deewhyarc-glitch
Copy link

Summary

This change retries daily Garmin stat downloads when transient API failures occur.

In particular, HRV downloads can fail intermittently for specific dates. Before this change, those failures were logged and then skipped, which could leave gaps in downloaded data. With this patch, stat downloads retry up to 5 times with a short backoff before giving up.

Changes

  • add retry logic in Download.__get_stat
  • make __get_hrv_day re-raise fetch failures so they participate in the retry loop
  • add a regression test covering retry-until-success and stop-after-five-failures behavior

Why

I hit intermittent HRV download failures on specific dates. Retrying the stat fetch resolves transient failures without requiring manual reruns and makes the HRV import path more robust.

Testing

Ran:

PYTHONPATH=/home/adam/GarminDB /home/adam/GarminDB/.venv/bin/python /home/adam/GarminDB/test/test_download.py

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