From 4c7abea58940ea004c46b19551c4e2563eaacece Mon Sep 17 00:00:00 2001 From: mkelvers Date: Tue, 23 Jun 2026 17:16:56 +0200 Subject: [PATCH] refactor: inline single-use getcached wrapper --- internal/episodes/service/cache_store.go | 4 ---- internal/episodes/service/service.go | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/internal/episodes/service/cache_store.go b/internal/episodes/service/cache_store.go index 43d9e65..96f2442 100644 --- a/internal/episodes/service/cache_store.go +++ b/internal/episodes/service/cache_store.go @@ -131,10 +131,6 @@ func (s *EpisodeService) markFailure(ctx context.Context, anime domain.Anime, ca ) } -func (s *EpisodeService) getCached(ctx context.Context, anime domain.Anime) (domain.CanonicalEpisodeList, bool) { - return s.getDecodedCached(ctx, anime) -} - func (s *EpisodeService) getFreshCached(ctx context.Context, anime domain.Anime) (domain.CanonicalEpisodeList, bool) { row, err := s.queries.GetEpisodeAvailabilityCache(ctx, int64(anime.MalID)) if err != nil { diff --git a/internal/episodes/service/service.go b/internal/episodes/service/service.go index 791033f..fb8bd53 100644 --- a/internal/episodes/service/service.go +++ b/internal/episodes/service/service.go @@ -141,7 +141,7 @@ func (s *EpisodeService) refresh(ctx context.Context, anime domain.Anime) (domai providerAvailability, source, providerErr := s.fetchProviderAvailability(ctx, anime) if providerErr != nil { s.markFailure(ctx, anime, providerErr) - if cached, ok := s.getCached(ctx, anime); ok { + if cached, ok := s.getDecodedCached(ctx, anime); ok { observability.Warn( "episodes_provider_failed_serving_stale_cache", "episodes",