Skip to content

Commit fc723ad

Browse files
committed
Add async to dropday querying
1 parent 5a68772 commit fc723ad

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

app/controllers/podcast_metrics_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ def episode_dropday_query(ep)
237237
Rollups::HourlyDownload
238238
.where(episode_id: ep[:guid], hour: (lowerbound..upperbound))
239239
.final
240+
.load_async
240241
.sum(:count)
241242
end
242243
end

app/javascript/controllers/apex_downloads_controller.js renamed to app/javascript/controllers/apex_sparkline_controller.js

File renamed without changes.

app/views/metrics/_episode_sparkline.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<span class="material-icons ms-1 z-1" aria-hidden="true"><%= trend[:direction] if trend.present? %></span>
77
</p>
88
<div class="position-absolute top-50 start-50 translate-middle w-100 h-100 z-0"
9-
data-controller="apex-downloads"
10-
data-apex-downloads-id-value="<%= episode.guid %>"
11-
data-apex-downloads-downloads-value="<%= downloads.to_json %>">
12-
<div data-apex-downloads-target="chart"></div>
9+
data-controller="apex-sparkline"
10+
data-apex-sparkline-id-value="<%= episode.guid %>"
11+
data-apex-sparkline-downloads-value="<%= downloads.to_json %>">
12+
<div data-apex-sparkline-target="chart"></div>
1313
</div>
1414
<% end %>

0 commit comments

Comments
 (0)