BUG-13506 SOLVED La sección ADMIN / Logs, opción Cron, se queda cargando y en consola de navegador se muestra el error 500 internal Server Error.

This commit is contained in:
Roly Gutierrez
2013-11-22 17:05:10 -04:00
parent 7463aa601b
commit 65bb06ff4e
8 changed files with 159 additions and 18 deletions

View File

@@ -89,6 +89,13 @@ class workspaceTools
$stop = microtime(true);
$final = $stop - $start;
CLI::logging("<*> Updating cache view Process took $final seconds.\n");
$start = microtime(true);
CLI::logging("> Backup log files...\n");
$this->backupLogFiles();
$stop = microtime(true);
$final = $stop - $start;
CLI::logging("<*> Backup log files Process took $final seconds.\n");
}
/**
@@ -1407,5 +1414,19 @@ class workspaceTools
return $result;
}
public function backupLogFiles()
{
clearstatcache();
$path = PATH_DATA . "log" . PATH_SEP;
$filePath = $path . "cron.log";
if (file_exists($filePath)) {
$size = filesize($filePath);
/* 5000000 -> approximately 5 megabytes */
if ($size > 5000000) {
rename($filePath, $filePath . ".bak");
}
}
}
}