From: Magnus Hagander Date: Mon, 7 Nov 2011 18:15:18 +0000 (+0000) Subject: Allow mirrors to be 10 seconds into the future, to allow for X-Git-Url: http://waps.l3s.uni-hannover.de/gitweb/?a=commitdiff_plain;h=c003533c84199245bc23794717456cf6bf665606;p=pgweb-old.git Allow mirrors to be 10 seconds into the future, to allow for frontends hosted behind varnish where this can happen because the checking script takes more than 1 second to run... git-svn-id: file:///Users/dpage/pgweb/svn-repo/trunk@2908 8f5c7a92-453e-0410-a47f-ad33c8a6b003 --- diff --git a/portal/tools/automirror/automirror.php b/portal/tools/automirror/automirror.php index ff7d2e5c..4b27eebf 100644 --- a/portal/tools/automirror/automirror.php +++ b/portal/tools/automirror/automirror.php @@ -48,7 +48,9 @@ function check_mirror($log, $db, $mirrtype, $MASTERIP, $MASTERHOST, $MIRRORHOST, } $diff = $wwwmaster->_lastupdate - $current->_lastupdate; - if ($diff < 0) { + // We allow for a mirror to claim it's 10 seconds in the + // future, to allow for varnish'ed dynamic sites + if ($diff < 10) { $log->Log('Mirror ' . $row[1] . ' (' . $row[3] . ') claims to be newer than master!'); $log->Log('Mirror has ' . $current->LastUpdatedStr() . ', master has ' . $wwwmaster->LastUpdatedStr()); if ($row[2] == 1) {