File tree Expand file tree Collapse file tree 1 file changed +1
-7
lines changed
Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Original file line number Diff line number Diff line change @@ -56,10 +56,6 @@ def published_seasons
5656 episodes . published . dropdate_desc . pluck ( :season_number ) . uniq . compact
5757 end
5858
59- def latest_season
60- published_seasons . first
61- end
62-
6359 def season_download_rollups
6460 published_seasons . map do |season |
6561 downloads_by_season ( season_number : season ) . to_a . flatten . presence
@@ -79,9 +75,7 @@ def downloads_by_season(season_number:)
7975 season_episodes_guids = episodes . published . where ( season_number : season_number ) . pluck ( :guid )
8076 return default if season_episodes_guids . blank?
8177
82- expiration = ( season_number == latest_season ) ? 1 . hour : 1 . month
83-
84- results = metrics_cache_fetch ( "#{ metrics_cache_key } /downloads_by_season/#{ season_number } " , expires_in : expiration ) do
78+ results = metrics_cache_fetch ( "#{ metrics_cache_key } /downloads_by_season/#{ season_number } " , expires_in : 1 . hour ) do
8579 Rollups ::HourlyDownload
8680 . where ( podcast_id : id )
8781 . where ( episode_id : season_episodes_guids )
You can’t perform that action at this time.
0 commit comments