diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-06-29 10:29:12 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-06-29 10:29:12 +0000 |
| commit | 8c55b9b10fecd45ac5acf3f13fc23d342a4aa53b (patch) | |
| tree | d0e596f79980af79eed6e0e657d667e4758a9520 /internal/handlers/timeline.go | |
| parent | d826bf5e9561a8c66a2c52bb1c2a3835fc6de32c (diff) | |
fix: calendar/meals sync, tomorrow flat layout, /health endpoint
- Calendar: fall back to GOOGLE_CALENDAR_ID config when no source_configs
synced yet (fixes blank calendar after fresh deploy)
- Meals: call fetchMeals in HandleTimeline so PlanToEat cache refreshes
on every timeline load, not just during manual refresh
- Tomorrow section: replace calendar-grid with flat chronological list
matching widget layout (time label | source bar | title)
- Add /health endpoint (no auth required) for deploy health checks
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/handlers/timeline.go')
| -rw-r--r-- | internal/handlers/timeline.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/handlers/timeline.go b/internal/handlers/timeline.go index bbdae51..2c3c6b6 100644 --- a/internal/handlers/timeline.go +++ b/internal/handlers/timeline.go @@ -69,6 +69,13 @@ func (h *Handler) HandleTimeline(w http.ResponseWriter, r *http.Request) { log.Printf("Warning: failed to fetch calendar events: %v", err) } + // Refresh meals cache before building timeline + if h.planToEatClient != nil { + if _, err := h.fetchMeals(r.Context(), false); err != nil { + log.Printf("Warning: failed to fetch meals: %v", err) + } + } + // Call BuildTimeline items, err := BuildTimeline(r.Context(), h.store, start, end) if err != nil { |
