N°4387 synchro_import restore previous set_time_limit call

Was changed in b1761e04 (iTop 2.7.0) by mistake

Added noinspection as the IDE warning (https://github.com/kalessil/phpinspectionsea/blob/master/docs/control-flow.md#statement-could-be-decoupled-from-foreach) seems to be a false positive ?
This commit is contained in:
Pierre Goiffon
2021-11-08 16:12:38 +01:00
parent 8c7f7abaab
commit 06985d3cf2

View File

@@ -512,16 +512,16 @@ try
$iLoopTimeLimit = MetaModel::GetConfig()->Get('max_execution_time_per_loop');
$oMutex = new iTopMutex('synchro_import_'.$oDataSource->GetKey());
$oMutex->Lock();
set_time_limit($iLoopTimeLimit);
foreach ($aData as $iRow => $aRow)
{
/** @noinspection DisconnectedForeachInstructionInspection */
set_time_limit($iLoopTimeLimit);
$sReconciliationCondition = '`primary_key` = '.CMDBSource::Quote($aRow[$iPrimaryKeyCol]);
$sSelect = "SELECT COUNT(*) FROM `$sTable` WHERE $sReconciliationCondition";
$aRes = CMDBSource::QueryToArray($sSelect);
$iCount = (int)$aRes[0]['COUNT(*)'];
if ($iCount === 0)
{
if ($iCount === 0) {
// No record... create it
//
$iCountCreations++;