Add configurable sync_lookback_days for Garmin Connect
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:
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user