mirror of
https://github.com/System-End/hackatime.git
synced 2026-04-19 21:05:15 +00:00
Revert "Fix grouped duration_seconds overcounting by using global LAG instead…" (#1077)
This reverts commit 972d6d2e33.
This commit is contained in:
parent
d38b7f71f5
commit
b915f6d4d9
1 changed files with 2 additions and 2 deletions
|
|
@ -223,8 +223,8 @@ module Heartbeatable
|
|||
|
||||
capped_diffs = scope
|
||||
.select("#{group_expr} as grouped_time, CASE
|
||||
WHEN LAG(time) OVER (ORDER BY time) IS NULL THEN 0
|
||||
ELSE LEAST(time - LAG(time) OVER (ORDER BY time), #{timeout})
|
||||
WHEN LAG(time) OVER (PARTITION BY #{group_expr} ORDER BY time) IS NULL THEN 0
|
||||
ELSE LEAST(time - LAG(time) OVER (PARTITION BY #{group_expr} ORDER BY time), #{timeout})
|
||||
END as diff")
|
||||
.where.not(time: nil)
|
||||
.unscope(:group)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue