mirror of
https://github.com/plausible/analytics.git
synced 2024-12-23 17:44:43 +03:00
Fix crash when calculating visit duration with 0 sessions
This commit is contained in:
parent
61676db4a7
commit
968d280304
@ -25,7 +25,7 @@ defmodule Plausible.Stats.Fragments do
|
|||||||
|
|
||||||
defmacro visit_duration() do
|
defmacro visit_duration() do
|
||||||
quote do
|
quote do
|
||||||
fragment("toUInt32(round(avg(duration * sign)))")
|
fragment("toUInt32(ifNotFinite(round(avg(duration * sign)), 0))")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user