From: vincent@cubedesigners.com Date: Mon, 19 Feb 2018 16:14:25 +0000 (+0000) Subject: #1933 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=b8aaf86ae5cd320051a35eca22c46e45442343fb;p=cubeextranet.git #1933 @0.5 --- diff --git a/inc/ws/Controlleur/class.ws.maintenance.php b/inc/ws/Controlleur/class.ws.maintenance.php index d820dd2e7..7901b37bd 100644 --- a/inc/ws/Controlleur/class.ws.maintenance.php +++ b/inc/ws/Controlleur/class.ws.maintenance.php @@ -523,12 +523,10 @@ class wsMaintenance { } public static function cleanPackages() { - $limit = TIME - (4 * 3600); // 4 heures avant maintenant* + $limit = TIME - (2 * 3600); // 4 heures avant maintenant* // - $dirs = array(ROOT . '/cache/download', - WS_FILES . '/packager/download/', - // WS_FILES . '/packager/', - //'/home/ws/www/download', + $dirs = array( + WS_FILES . '/packager/' ); // Clean downloads @@ -542,6 +540,9 @@ class wsMaintenance { continue; } $f = $dir . $file; + if ($file == 'download') { + continue; + } if (!is_dir($f)) { continue; } @@ -980,18 +981,14 @@ class wsMaintenance { } public static function cleanDownload($args) { - $root = ROOT . '/cache/download/'; - cubeFiles::scanRecursiveDir($root, $files); - $limit = TIME - 14400; - foreach ($files as $f) { - if (filemtime($f) < $limit) { - unlink($f); - } - } - $files = cubeFiles::scandir($root, true); - foreach ($files as $f) { - if (cubeFiles::isEmpty($f)) { - @rmdir($f); + $dirs = [ROOT . '/cache/download/', WS_FILES . '/packager/download']; + foreach ($dirs as $dir) { + cubeFiles::scanRecursiveDir($dir, $files); + $limit = TIME - 7200; + foreach ($files as $f) { + if (filemtime($f) < $limit) { + unlink($f); + } } } }