Skip to content

Commit

Permalink
We don't passively disable mirrors anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
bjori committed Apr 28, 2015
1 parent 7aa7b88 commit 8262bab
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions fetch/mirrors.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,9 @@
// Select phpmasterdb database
if (@mysql_select_db("phpmasterdb")) {

// Select last mirror check time from table
$lct = mysql_query("SELECT UNIX_TIMESTAMP(lastchecked) FROM mirrors ORDER BY lastchecked DESC LIMIT 1");
list($checktime) = mysql_fetch_row($lct);

// Select mirrors list with some on-the-fly counted columns
$res = @mysql_query(
"SELECT mirrors.*, country.name AS cname, " .
"(DATE_SUB(FROM_UNIXTIME($checktime), INTERVAL 3 DAY) < mirrors.lastchecked) AS up, " .
"(DATE_SUB(FROM_UNIXTIME($checktime), INTERVAL 7 DAY) < mirrors.lastupdated) AS current " .
"SELECT mirrors.*, country.name AS cname " .
"FROM mirrors LEFT JOIN country ON mirrors.cc = country.id " .
"ORDER BY country.name,hostname"
);
Expand Down Expand Up @@ -86,8 +80,7 @@
// Provide status information for mirrors
// computed from current mirror details
if (!$row["active"]) { $status = 'MIRROR_NOTACTIVE'; }
elseif (!$row["up"]) { $status = 'MIRROR_DOESNOTWORK'; }
elseif (!$row["current"]) { $status = 'MIRROR_OUTDATED'; }
elseif ($row["ocmt"]) { $status = 'MIRROR_DOESNOTWORK'; }

// Print out the array element for this mirror
echo " \"$row[hostname]\" => array(\n" .
Expand Down

0 comments on commit 8262bab

Please sign in to comment.