Add feature switch for woo commerce list sync

[MAILPOET-1732]
This commit is contained in:
Rostislav Wolny
2019-04-23 16:13:46 +02:00
committed by M. Shull
parent 9d7707b98f
commit daca92097c
9 changed files with 27 additions and 2 deletions

View File

@@ -2,6 +2,7 @@
namespace MailPoet\Cron;
use MailPoet\Cron\Workers\WorkersFactory;
use MailPoet\Settings\SettingsController;
if (!defined('ABSPATH')) exit;
@@ -29,7 +30,10 @@ class Daemon {
$this->executeBounceWorker();
$this->executeExportFilesCleanupWorker();
$this->executeInactiveSubscribersWorker();
$this->executeWooCommerceSyncWorker();
$settings = new SettingsController();
if ($settings->get('woo_commerce_list_sync_enabled')) {
$this->executeWooCommerceSyncWorker();
}
} catch (\Exception $e) {
CronHelper::saveDaemonLastError($e->getMessage());
}