N°5900 - DB integrity analysis crashes when too many errors - limit the results to 100 to avoid memory errors

This commit is contained in:
Eric Espie
2023-01-19 08:51:02 +01:00
parent 9dc54d6e4c
commit f75a51d59e
6 changed files with 25 additions and 4 deletions

View File

@@ -21,6 +21,8 @@ use Combodo\iTop\Core\MetaModel\HierarchicalKey;
class DatabaseAnalyzer
{
const LIMIT = 100;
var $iTimeLimitPerOperation;
public function __construct($iTimeLimitPerOperation = null)
@@ -45,7 +47,7 @@ class DatabaseAnalyzer
set_time_limit(intval($this->iTimeLimitPerOperation));
}
$aWrongRecords = CMDBSource::QueryToArray($sSelWrongRecs);
$aWrongRecords = CMDBSource::QueryToArray($sSelWrongRecs.' limit '.self::LIMIT);
if (count($aWrongRecords) > 0)
{
foreach($aWrongRecords as $aRes)