diff --git a/core/asynctask.class.inc.php b/core/asynctask.class.inc.php index 74bb54479..25f54c76e 100644 --- a/core/asynctask.class.inc.php +++ b/core/asynctask.class.inc.php @@ -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) {