Browse Source

Limit the number of inserted placeholders.

Otherwise, if period=1m and grace=1m then we can end up generating huge useless tables.
pull/27/head
Pēteris Caune 9 years ago
parent
commit
8e8d9abe3b
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      hc/front/views.py

+ 3
- 1
hc/front/views.py View File

@ -215,9 +215,11 @@ def log(request, code):
# Fill in "missed ping" placeholders:
expected_date = older.created + check.timeout
while expected_date + check.grace < newer.created:
limit = 0
while expected_date + check.grace < newer.created and limit < 10:
wrapped.append({"placeholder_date": expected_date})
expected_date = expected_date + check.timeout
limit += 1
# Prepare early flag for next ping to come
early = older.created + check.timeout > newer.created + check.grace


Loading…
Cancel
Save