Some PHPDoc and small reformat

SVN:trunk[5139]
This commit is contained in:
Pierre Goiffon
2017-11-23 17:42:24 +00:00
parent 72563d8ef1
commit 3cd28d1559
2 changed files with 22 additions and 9 deletions

View File

@@ -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;
}

View File

@@ -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();