Store the in_progress flag for all workers [MAILPOET-2443]

This commit is contained in:
wxa
2019-10-08 16:24:31 +03:00
committed by Jack Kitterhing
parent f98ed72d83
commit c7b0f50c4c

View File

@ -108,15 +108,14 @@ abstract class SimpleWorker {
if ($this->isInProgress($task)) { if ($this->isInProgress($task)) {
return false; return false;
} }
$this->startProgress($task);
} }
$this->startProgress($task);
try { try {
$completed = $this->processTaskStrategy($task); $completed = $this->processTaskStrategy($task);
} catch (\Exception $e) { } catch (\Exception $e) {
if (!static::SUPPORT_MULTIPLE_INSTANCES) { $this->stopProgress($task);
$this->stopProgress($task);
}
throw $e; throw $e;
} }
@ -124,9 +123,7 @@ abstract class SimpleWorker {
$this->complete($task); $this->complete($task);
} }
if (!static::SUPPORT_MULTIPLE_INSTANCES) { $this->stopProgress($task);
$this->stopProgress($task);
}
return (bool)$completed; return (bool)$completed;
} }