]> git.openstreetmap.org Git - chef.git/commitdiff
planet: run mirror redirect more often, fix minor escaping issue
authorGrant Slater <git@firefishy.com>
Wed, 5 Feb 2020 20:19:03 +0000 (20:19 +0000)
committerGrant Slater <git@firefishy.com>
Wed, 5 Feb 2020 20:19:03 +0000 (20:19 +0000)
cookbooks/planet/templates/default/planet-dump-mirror-cron.erb
cookbooks/planet/templates/default/planet-mirror-redirect-update.erb

index 3feec3f491803146daf94d475d3b811a40577ac0..d635c107ea2bc0c479a71f3a343312b3c105c093 100644 (file)
@@ -1,3 +1,3 @@
 # DO NOT EDIT - This file is being maintained by Chef
 MAILTO=horntail-www-data-cron@firefishy.com
-20 */2 * * * www-data /usr/local/bin/planet-mirror-redirect-update
+*/10 * * * * www-data /usr/local/bin/planet-mirror-redirect-update
index 33abc665149e5988dd1ddd92a1c2ea0f21a48c89..2c651eada6106fedad93297dec98b6238e295c03 100644 (file)
@@ -66,7 +66,7 @@ foreach ($_FOLDERS as $FOLDER) {
   if ($dh = opendir($_PLANET_FOLDER)) {
     while (($file = readdir($dh)) !== false ) {
       if (preg_match($_PLANET_REGEX, $file)) {
-        $file_slashed = $FOLDER['DIR_PREFIX'].str_replace(array('.','-'), array('\.','\-'), $file);
+        $file_slashed = str_replace(array('.','-'), array('\.','\-'), $FOLDER['DIR_PREFIX'].$file);
         if (strpos($htaccess_contents, $file_slashed) === false) {
           $file_size = filesize($_PLANET_FOLDER.$file);
           sleep(rand(2,5));