Upgrades to Live and API Caching

This commit is contained in:
AmanTahiliani committed 2026-03-27 00:30:53 -04:00
1 parent 7c2fcfef8d
commit 360bde4602
19 files changed
+838 -225

No files matched your search

+11 -1
View File
@@ -11,7 +11,17 @@ import (
)
func main() {
client := api.NewOpenF1Client("https://api.openf1.org", 15*time.Second)
var client *api.OpenF1Client
if apiKey := os.Getenv("OPENF1_API_KEY"); apiKey != "" {
client = api.NewOpenF1ClientWithKey("https://api.openf1.org", 15*time.Second, apiKey)
} else {
client = api.NewOpenF1Client("https://api.openf1.org", 15*time.Second)
}
defer client.Close()
// Clean up old file-based cache (one-time migration).
go api.CleanupOldFileCache()
model := ui.NewAppModel(client)
p := tea.NewProgram(