Add debug logging for fitnessage API response
Build and push images / validate (push) Successful in 3s
Build and push images / build-backend (push) Successful in 5s
Build and push images / build-worker (push) Successful in 5s
Build and push images / build-frontend (push) Successful in 5s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-07 21:29:19 +01:00
parent 8fd7f984d9
commit e440fb35dd
@@ -328,11 +328,13 @@ def sync_wellness(garmin, user_id: int, since: Optional[datetime], db,
# Fetch current VO2 max and fitness age once (slow-changing — only update today's row) # Fetch current VO2 max and fitness age once (slow-changing — only update today's row)
today_str = date.today().isoformat() today_str = date.today().isoformat()
fa_data = _safe(garmin.get_fitnessage_data, today_str) fa_data = _safe(garmin.get_fitnessage_data, today_str)
logger.info("fitnessage raw response: %s", fa_data)
if fa_data: if fa_data:
vo2 = (fa_data.get("vo2Max") vo2 = (fa_data.get("vo2Max")
or fa_data.get("vo2MaxPreciseValue") or fa_data.get("vo2MaxPreciseValue")
or fa_data.get("biometricProfile", {}).get("vo2Max")) or fa_data.get("biometricProfile", {}).get("vo2Max"))
fa = fa_data.get("chronologicalAge") or fa_data.get("fitnessAge") fa = fa_data.get("chronologicalAge") or fa_data.get("fitnessAge")
logger.info("fitnessage parsed: vo2=%s fa=%s", vo2, fa)
if vo2 and float(vo2) > 0: if vo2 and float(vo2) > 0:
try: try:
fa_row = {"vo2max": float(vo2)} fa_row = {"vo2max": float(vo2)}