mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 23:32:17 +02:00
Improved the processing of background task to enable more advanced functionalities like queuing (protection against reentrance) -reintegrated from trunk
SVN:2.0.3[3314]
This commit is contained in:
@@ -120,10 +120,17 @@ abstract class AsyncTask extends DBObject
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$this->Set('status', 'running');
|
if ($this->Get('status') == 'running')
|
||||||
$this->Set('started', time());
|
{
|
||||||
$this->DBUpdate();
|
return self::ALREADY_RUNNING;
|
||||||
return self::OK;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->Set('status', 'running');
|
||||||
|
$this->Set('started', time());
|
||||||
|
$this->DBUpdate();
|
||||||
|
return self::OK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch(Exception $e)
|
catch(Exception $e)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user