mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-20 00:58:48 +02:00
Some PHPDoc and small reformat
SVN:trunk[5139]
This commit is contained in:
@@ -186,7 +186,7 @@ abstract class AsyncTask extends DBObject
|
||||
* @return boolean True if the task record can be deleted
|
||||
*/
|
||||
public function Process()
|
||||
{
|
||||
{
|
||||
// By default: consider that the task is not completed
|
||||
$bRet = false;
|
||||
|
||||
@@ -196,16 +196,15 @@ abstract class AsyncTask extends DBObject
|
||||
{
|
||||
try
|
||||
{
|
||||
$sStatus = $this->DoProcess();
|
||||
if ($this->Get('event_id') != 0)
|
||||
{
|
||||
$oEventLog = MetaModel::GetObject('Event', $this->Get('event_id'));
|
||||
$oEventLog->Set('message', $sStatus);
|
||||
$oEventLog->DBUpdate();
|
||||
$sStatus = $this->DoProcess();
|
||||
if ($this->Get('event_id') != 0)
|
||||
{
|
||||
$oEventLog = MetaModel::GetObject('Event', $this->Get('event_id'));
|
||||
$oEventLog->Set('message', $sStatus);
|
||||
$oEventLog->DBUpdate();
|
||||
}
|
||||
$bRet = true;
|
||||
}
|
||||
catch(Exception $e)
|
||||
} catch (Exception $e)
|
||||
{
|
||||
$this->HandleError($e->getMessage(), $e->getCode());
|
||||
}
|
||||
@@ -215,6 +214,7 @@ abstract class AsyncTask extends DBObject
|
||||
// Already done or being handled by another process... skip...
|
||||
$bRet = false;
|
||||
}
|
||||
|
||||
return $bRet;
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,14 @@ function UsageAndExit($oP)
|
||||
exit -2;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param iProcess $oProcess
|
||||
* @param \BackgroundTask $oTask
|
||||
* @param DateTime $oStartDate
|
||||
* @param int $iTimeLimit
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function RunTask($oProcess, BackgroundTask $oTask, $oStartDate, $iTimeLimit)
|
||||
{
|
||||
$oNow = new DateTime();
|
||||
@@ -117,6 +125,11 @@ function RunTask($oProcess, BackgroundTask $oTask, $oStartDate, $iTimeLimit)
|
||||
return $sMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param CLIPage|WebPage $oP
|
||||
* @param iProcess[] $aProcesses
|
||||
* @param boolean $bVerbose
|
||||
*/
|
||||
function CronExec($oP, $aProcesses, $bVerbose)
|
||||
{
|
||||
$iStarted = time();
|
||||
|
||||
Reference in New Issue
Block a user