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:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user