Browse Source

Update _get_events to work same way as hc.api.views.pings (iterate over pings in ascending order)

pull/379/head
Pēteris Caune 4 years ago
parent
commit
0e5d578360
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      hc/front/views.py

+ 4
- 4
hc/front/views.py View File

@ -478,11 +478,11 @@ def _get_events(check, limit):
pings = list(pings)
prev = None
for ping in pings:
if ping.kind == "start" and prev and prev.kind != "start":
delta = prev.created - ping.created
for ping in reversed(pings):
if ping.kind != "start" and prev and prev.kind == "start":
delta = ping.created - prev.created
if delta < MAX_DELTA:
setattr(prev, "delta", delta)
setattr(ping, "delta", delta)
prev = ping


Loading…
Cancel
Save