index : archweb32 | |
Archlinux32 website | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2019-11-04 09:09:03 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-11-04 09:09:40 +0100 |
commit | e50fe76394d3d35f75587795af220682ffbe74f9 (patch) | |
tree | 791bec4b40645f20279be1b0aa95166a77c63f42 /mirrors.php | |
parent | a674e136827d1d2a6459402ce634080011127ee7 (diff) |
-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); |