index : archweb32 | |
Archlinux32 website | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | mirrors.php | 7 |
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); |