mirror of
https://github.com/AmanTahiliani/box-box.git
synced 2026-08-07 19:56:18 -04:00
Parallelize championship hub fetches and cache aggregated response
Cold-cache hub loads previously issued ~70 sequential OpenF1 calls. Per-meeting fetches now fan out 5-wide (order preserved), and the aggregated response is cached in memory: 15min TTL for the current season, 24h for past seasons. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,10 +20,11 @@ var assetsFS embed.FS
|
||||
|
||||
// Server is the box-box web companion HTTP server.
|
||||
type Server struct {
|
||||
client *api.OpenF1Client
|
||||
query *query.Service
|
||||
hub *SSEHub
|
||||
addr string
|
||||
client *api.OpenF1Client
|
||||
query *query.Service
|
||||
hub *SSEHub
|
||||
addr string
|
||||
hubCache champHubCache // aggregated championship hub responses, keyed by year
|
||||
}
|
||||
|
||||
// NewServer creates a new Server. Call Start() to begin serving.
|
||||
|
||||
Reference in New Issue
Block a user