From 487fb81f8d151ac39b7e40b11b45f26b5f91575c Mon Sep 17 00:00:00 2001 From: pajlada Date: Wed, 11 Jan 2023 11:39:35 +0100 Subject: [PATCH] Increase YouTube cache time from 24h to 48h (#409) --- internal/resolvers/youtube/channel_resolver.go | 2 +- internal/resolvers/youtube/initialize.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/resolvers/youtube/channel_resolver.go b/internal/resolvers/youtube/channel_resolver.go index 9a96bc9c..58db5a4f 100644 --- a/internal/resolvers/youtube/channel_resolver.go +++ b/internal/resolvers/youtube/channel_resolver.go @@ -61,7 +61,7 @@ func NewYouTubeChannelResolver(ctx context.Context, cfg config.APIConfig, pool d r := &YouTubeChannelResolver{ channelCache: cache.NewPostgreSQLCache( - ctx, cfg, pool, cache.NewPrefixKeyProvider("youtube:channel"), loader, 24*time.Hour, + ctx, cfg, pool, cache.NewPrefixKeyProvider("youtube:channel"), loader, 48*time.Hour, ), } diff --git a/internal/resolvers/youtube/initialize.go b/internal/resolvers/youtube/initialize.go index f263bbd1..4f17344f 100644 --- a/internal/resolvers/youtube/initialize.go +++ b/internal/resolvers/youtube/initialize.go @@ -44,7 +44,7 @@ var ( func NewYouTubeVideoResolvers(ctx context.Context, cfg config.APIConfig, pool db.Pool, youtubeClient *youtubeAPI.Service) (resolver.Resolver, resolver.Resolver) { videoLoader := NewVideoLoader(youtubeClient) videoCache := cache.NewPostgreSQLCache( - ctx, cfg, pool, cache.NewPrefixKeyProvider("youtube:video"), videoLoader, 24*time.Hour, + ctx, cfg, pool, cache.NewPrefixKeyProvider("youtube:video"), videoLoader, 48*time.Hour, ) videoResolver := NewYouTubeVideoResolver(videoCache)