summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2018-07-20 21:59:23 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2018-07-20 21:59:23 -0400
commit01506701f9053f9f8971ddda87bdf4a1fb24cdea (patch)
treee41fdeb904143fc66e0f9b983f00b94fe3e90fb4
parent20b7523cb72ebcac181284545b4a117a218aa248 (diff)
better debugging
-rw-r--r--mirror.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/mirror.php b/mirror.php
index 9a6706f..866d66a 100644
--- a/mirror.php
+++ b/mirror.php
@@ -40,10 +40,8 @@ if (!file_exists($root.'/'.$filename)) {
$mirror = $tier0_url;
if (!should_force_tier0($filename)) {
$ctime = lstat($root.'/'.$filename)['ctime'];
- if ($ctime < $min_ctime) {
- $ctime = $min_ctime;
- }
- header('X-Repomirror-C-Time: '.$ctime);
+ header('X-Repomirror-File-C-Time: '.$ctime);
+ header('X-Repomirror-Min-C-Time: '.$min_ctime);
// TODO: weight by GeoIP or quality or something?
$mirrors = array();
foreach ($mirrors_urls as $mirrors_url) {
@@ -59,7 +57,7 @@ if (!file_exists($root.'/'.$filename)) {
}
foreach ($json['urls'] as $urldata) {
if (!in_array($urldata['protocol'], ['http', 'https', 'ftp'])) { continue; }
- if (strtotime($urldata['last_sync']) < $ctime) { continue; }
+ if (strtotime($urldata['last_sync']) < max($ctime, $min_ctime)) { continue; }
header('X-Repomirror-Mirror'.count($mirrors).': '.strtotime($urldata['last_sync']).' '.$urldata['url']);
$mirrors[] = $urldata['url'];
}