mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 07:12:26 +02:00
N°9169 - Refactor code
This commit is contained in:
@@ -1989,14 +1989,7 @@ JS
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Use mutex to check if cron is running
|
// Use mutex to check if cron is running
|
||||||
$oMutex = new iTopMutex(
|
$oMutex = self::GetCronMutex($oConfig);
|
||||||
'cron'.$oConfig->Get('db_name').$oConfig->Get('db_subname'),
|
|
||||||
$oConfig->Get('db_host'),
|
|
||||||
$oConfig->Get('db_user'),
|
|
||||||
$oConfig->Get('db_pwd'),
|
|
||||||
$oConfig->Get('db_tls.enabled'),
|
|
||||||
$oConfig->Get('db_tls.ca')
|
|
||||||
);
|
|
||||||
$iCount = 1;
|
$iCount = 1;
|
||||||
$iStarted = time();
|
$iStarted = time();
|
||||||
$iMaxDuration = $oConfig->Get('cron_max_execution_time');
|
$iMaxDuration = $oConfig->Get('cron_max_execution_time');
|
||||||
@@ -2014,6 +2007,26 @@ JS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param \Config $oConfig
|
||||||
|
*
|
||||||
|
* @return \iTopMutex
|
||||||
|
* @since 3.3.0
|
||||||
|
*/
|
||||||
|
public static function GetCronMutex(Config $oConfig): iTopMutex
|
||||||
|
{
|
||||||
|
$oMutex = new iTopMutex(
|
||||||
|
'cron'.$oConfig->Get('db_name').$oConfig->Get('db_subname'),
|
||||||
|
$oConfig->Get('db_host'),
|
||||||
|
$oConfig->Get('db_user'),
|
||||||
|
$oConfig->Get('db_pwd'),
|
||||||
|
$oConfig->Get('db_tls.enabled'),
|
||||||
|
$oConfig->Get('db_tls.ca')
|
||||||
|
);
|
||||||
|
|
||||||
|
return $oMutex;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create and store Setup authentication token
|
* Create and store Setup authentication token
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user