summaryrefslogtreecommitdiff
path: root/mirrors
diff options
context:
space:
mode:
Diffstat (limited to 'mirrors')
-rw-r--r--mirrors/utils.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/mirrors/utils.py b/mirrors/utils.py
index a26b19ce..e6d6c1dd 100644
--- a/mirrors/utils.py
+++ b/mirrors/utils.py
@@ -40,7 +40,11 @@ def get_mirror_statuses(cutoff=default_cutoff):
check_info = MirrorLog.objects.filter(
check_time__gte=cutoff_time).aggregate(
mn=Min('check_time'), mx=Max('check_time'))
- check_frequency = (check_info['mx'] - check_info['mn']) / num_checks
+ if num_checks > 1:
+ check_frequency = (check_info['mx'] - check_info['mn']) \
+ / (num_checks - 1)
+ else:
+ check_frequency = None;
else:
last_check = None
num_checks = 0