mproved the processing of background task to enable more advanced functionalities like queuing (protection against reentrance)

SVN:trunk[3313]
This commit is contained in:
Romain Quetiez
2014-09-03 09:53:55 +00:00
parent e831b1a486
commit 7ed60f711c

View File

@@ -120,10 +120,17 @@ abstract class AsyncTask extends DBObject
{
try
{
$this->Set('status', 'running');
$this->Set('started', time());
$this->DBUpdate();
return self::OK;
if ($this->Get('status') == 'running')
{
return self::ALREADY_RUNNING;
}
else
{
$this->Set('status', 'running');
$this->Set('started', time());
$this->DBUpdate();
return self::OK;
}
}
catch(Exception $e)
{