Move exception handling from concrete workers into processTask() [MAILPOET-2385]

This commit is contained in:
wxa
2019-09-30 07:59:33 +03:00
committed by Jack Kitterhing
parent 2a0bf3f3c8
commit 2a48d0846d
6 changed files with 29 additions and 68 deletions

View File

@@ -27,12 +27,7 @@ class WooCommerceSync extends SingleInstanceSimpleWorker {
}
function processTaskStrategy(ScheduledTask $task) {
try {
$this->woocommerce_segment->synchronizeCustomers();
} catch (\Exception $e) {
$this->stopProgress($task);
throw $e;
}
$this->woocommerce_segment->synchronizeCustomers();
return true;
}