Add configurable sync_lookback_days for Garmin Connect
Build and push images / validate (push) Successful in 2s
Build and push images / build-backend (push) Successful in 7s
Build and push images / build-worker (push) Successful in 6s
Build and push images / build-frontend (push) Successful in 10s

Users can now set how many days back the first sync fetches. -1 syncs all
history back to 2010; any positive value sets a rolling window. Values
over 365 show a rate-limit warning in the UI. The default remains 30 days.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-07 00:40:55 +01:00
parent 335bd0a053
commit f8c126fbda
4 changed files with 31 additions and 10 deletions
+2 -1
View File
@@ -499,7 +499,8 @@ def sync_garmin_connect_user(user_id: int):
if cfg.sync_activities:
try:
activities_queued = sync_activities(
garmin, user_id, cfg.last_sync_at, db, settings.file_store_path
garmin, user_id, cfg.last_sync_at, db, settings.file_store_path,
lookback_days=cfg.sync_lookback_days if cfg.sync_lookback_days is not None else 30,
)
except Exception as exc:
errors.append(f"activities: {exc}")