feat: bound in-memory caches with LRU eviction

This commit is contained in:
2026-05-10 18:04:29 +02:00
parent cc81347ace
commit d021a8eadd
6 changed files with 56 additions and 69 deletions

View File

@@ -2,6 +2,7 @@ package server
import (
"database/sql"
"fmt"
"net/http"
"path/filepath"
"strings"
@@ -72,9 +73,12 @@ func NewRouter(cfg Config) http.Handler {
animeSvc := anime.NewService(cfg.JikanClient, cfg.DB)
animeHandler := anime.NewHandler(animeSvc)
playbackSvc := playback.NewService(cfg.DB, cfg.SQLDB, playback.Config{
playbackSvc, err := playback.NewService(cfg.DB, cfg.SQLDB, playback.Config{
ProxyTokenSecret: cfg.PlaybackProxySecret,
})
if err != nil {
panic(fmt.Sprintf("failed to initialize playback service: %v", err))
}
playbackHandler := playback.NewHandler(playbackSvc, cfg.JikanClient)
// Serve static files with no-cache headers