summaryrefslogtreecommitdiff
path: root/mirrors.php
diff options
context:
space:
mode:
Diffstat (limited to 'mirrors.php')
-rw-r--r--mirrors.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/mirrors.php b/mirrors.php
index feffc9a..0a57ce6 100644
--- a/mirrors.php
+++ b/mirrors.php
@@ -216,8 +216,11 @@ if ($uri_parts[0] == 'status') {
) as $key)
$row[$key] = floatval($row[$key]);
$row["last_sync"] = gmdate("Y-m-d\TH:i:s\Z", $row["last_sync"]);
- $row["score"] =
- ($row["delay"] + $row["duration_avg"] + $row["duration_stddev"]) / $row["completion_pct"];
+ if ($row["completion_pct"] == 0)
+ $row["score"] = 0;
+ else
+ $row["score"] =
+ ($row["delay"] + $row["duration_avg"] + $row["duration_stddev"]) / $row["completion_pct"];
$urls[] = $row;
$last_check = max ($row["start"], $last_check);
$max_count = max ($row["count"], $max_count);