Skip to content

Commit

Permalink
Update aggregate.ex
Browse files Browse the repository at this point in the history
  • Loading branch information
macobo committed Jun 27, 2024
1 parent bf85d05 commit fbf7dd7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/plausible/stats/aggregate.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ defmodule Plausible.Stats.Aggregate do

Query.trace(query, metrics)

q = Plausible.Stats.SQL.QueryBuilder.build(query, site)
query_with_metrics = %Query{query | metrics: metrics}

q = Plausible.Stats.SQL.QueryBuilder.build(query_with_metrics, site)

time_on_page_task =
if :time_on_page in query.metrics do
if :time_on_page in query_with_metrics.metrics do
fn -> aggregate_time_on_page(site, query) end
else
fn -> %{} end
Expand Down

0 comments on commit fbf7dd7

Please sign in to comment.