Skip to content

Commit

Permalink
fix: use existing config entry
Browse files Browse the repository at this point in the history
  • Loading branch information
M4tthewDE committed Aug 31, 2024
1 parent d0cd4fb commit b329b19
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@
# Cache duration for Wikipedia article links
#wikipedia-article-cache-duration: 1h

# Cache duration for Twitch user links
#twitch-user-cache-duration: 1h
# Cache duration for Twitch username links
#twitch-username-cache-duration: 1h

# Minimum level of log message importance required for the log message to not be filtered out.
# Available levels: debug, info, warn, error
Expand Down
2 changes: 1 addition & 1 deletion internal/resolvers/twitch/user_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewUserResolver(ctx context.Context, cfg config.APIConfig, pool db.Pool, he

r := &UserResolver{
userCache: cache.NewPostgreSQLCache(ctx, cfg, pool, cache.NewPrefixKeyProvider("twitch:user"),
resolver.NewResponseMarshaller(userLoader), cfg.TwitchUserCacheDuration),
resolver.NewResponseMarshaller(userLoader), cfg.TwitchUsernameCacheDuration),
}

return r
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ type APIConfig struct {
SeventvEmoteCacheDuration time.Duration `mapstructure:"seventv-emote-cache-duration" json:"seventv-emote-cache-duration"`
SupinicTrackCacheDuration time.Duration `mapstructure:"supinic-track-cache-duration" json:"supinic-track-cache-duration"`
TwitchClipCacheDuration time.Duration `mapstructure:"twitch-clip-cache-duration" json:"twitch-clip-cache-duration"`
TwitchUserCacheDuration time.Duration `mapstructure:"twitch-user-cache-duration" json:"twitch-user-cache-duration"`
TwitterTweetCacheDuration time.Duration `mapstructure:"twitter-tweet-cache-duration" json:"twitter-tweet-cache-duration"`
TwitterUserCacheDuration time.Duration `mapstructure:"twitter-user-cache-duration" json:"twitter-user-cache-duration"`
WikipediaArticleCacheDuration time.Duration `mapstructure:"wikipedia-article-cache-duration" json:"wikipedia-article-cache-duration"`
YoutubeChannelCacheDuration time.Duration `mapstructure:"youtube-channel-cache-duration" json:"youtube-channel-cache-duration"`
YoutubeVideoCacheDuration time.Duration `mapstructure:"youtube-video-cache-duration" json:"youtube-video-cache-duration"`
TwitchUsernameCacheDuration time.Duration `mapstructure:"twitch-username-cache-duration" json:"twitch-user-cache-duration"`

LogLevel string `mapstructure:"log-level" json:"log-level"`
LogDevelopment bool `mapstructure:"log-development" json:"log-development"`
Expand Down

0 comments on commit b329b19

Please sign in to comment.