mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
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:
@@ -512,16 +512,16 @@ try
|
|||||||
$iLoopTimeLimit = MetaModel::GetConfig()->Get('max_execution_time_per_loop');
|
$iLoopTimeLimit = MetaModel::GetConfig()->Get('max_execution_time_per_loop');
|
||||||
$oMutex = new iTopMutex('synchro_import_'.$oDataSource->GetKey());
|
$oMutex = new iTopMutex('synchro_import_'.$oDataSource->GetKey());
|
||||||
$oMutex->Lock();
|
$oMutex->Lock();
|
||||||
set_time_limit($iLoopTimeLimit);
|
|
||||||
foreach ($aData as $iRow => $aRow)
|
foreach ($aData as $iRow => $aRow)
|
||||||
{
|
{
|
||||||
|
/** @noinspection DisconnectedForeachInstructionInspection */
|
||||||
|
set_time_limit($iLoopTimeLimit);
|
||||||
$sReconciliationCondition = '`primary_key` = '.CMDBSource::Quote($aRow[$iPrimaryKeyCol]);
|
$sReconciliationCondition = '`primary_key` = '.CMDBSource::Quote($aRow[$iPrimaryKeyCol]);
|
||||||
$sSelect = "SELECT COUNT(*) FROM `$sTable` WHERE $sReconciliationCondition";
|
$sSelect = "SELECT COUNT(*) FROM `$sTable` WHERE $sReconciliationCondition";
|
||||||
$aRes = CMDBSource::QueryToArray($sSelect);
|
$aRes = CMDBSource::QueryToArray($sSelect);
|
||||||
$iCount = (int)$aRes[0]['COUNT(*)'];
|
$iCount = (int)$aRes[0]['COUNT(*)'];
|
||||||
|
|
||||||
if ($iCount === 0)
|
if ($iCount === 0) {
|
||||||
{
|
|
||||||
// No record... create it
|
// No record... create it
|
||||||
//
|
//
|
||||||
$iCountCreations++;
|
$iCountCreations++;
|
||||||
|
|||||||
Reference in New Issue
Block a user