Skip to content

Commit a96b228

Browse files
committed
Wrap clickhouse queries in dev environment
1 parent 4fe2fe0 commit a96b228

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Gemfile.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ PLATFORMS
577577
arm64-darwin-22
578578
arm64-darwin-23
579579
arm64-darwin-24
580+
arm64-darwin-25
580581
x86_64-darwin-21
581582
x86_64-darwin-22
582583
x86_64-darwin-23

app/controllers/podcasts_controller.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ def show
2020

2121
@recently_published_episodes = @podcast.episodes.published.dropdate_desc.limit(4)
2222
@trend_episodes = @podcast.default_feed.episodes.published.dropdate_desc.where.not(first_rss_published_at: nil).offset(1).limit(4)
23-
@episode_trend_pairs = episode_trend_pairs(@recently_published_episodes, @trend_episodes)
24-
@alltime_downloads = alltime_downloads(@podcast).sum(&:count)
25-
@daterange_downloads = daterange_downloads(@podcast).sum(&:count)
23+
if Rails.env.development?
24+
@episode_trend_pairs = episode_trend_pairs(@recently_published_episodes, @trend_episodes)
25+
@alltime_downloads = alltime_downloads(@podcast).sum(&:count)
26+
@daterange_downloads = daterange_downloads(@podcast).sum(&:count)
27+
end
2628
@episode_count = @podcast.episodes.published.length
2729

2830
# @recently_published is used for the prod branch

0 commit comments

Comments
 (0)