Rename initApi() to init() in workers [PREMIUM-4]
This commit is contained in:
@@ -21,7 +21,7 @@ class Bounce extends SimpleWorker {
|
||||
|
||||
public $api;
|
||||
|
||||
function initApi() {
|
||||
function init() {
|
||||
if(!$this->api) {
|
||||
$mailer_config = Mailer::getMailerConfig();
|
||||
$this->api = new API($mailer_config['mailpoet_api_key']);
|
||||
|
@@ -13,7 +13,7 @@ abstract class KeyCheckWorker extends SimpleWorker {
|
||||
|
||||
public $bridge;
|
||||
|
||||
function initApi() {
|
||||
function init() {
|
||||
if(!$this->bridge) {
|
||||
$this->bridge = new Bridge();
|
||||
}
|
||||
|
@@ -19,12 +19,6 @@ abstract class SimpleWorker {
|
||||
CronHelper::enforceExecutionLimit($this->timer);
|
||||
}
|
||||
|
||||
function init() {
|
||||
if(is_callable(array($this, 'initApi'))) {
|
||||
$this->initApi();
|
||||
}
|
||||
}
|
||||
|
||||
function checkProcessingRequirements() {
|
||||
return true;
|
||||
}
|
||||
@@ -34,7 +28,9 @@ abstract class SimpleWorker {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->init();
|
||||
if(is_callable(array($this, 'init'))) {
|
||||
$this->init();
|
||||
}
|
||||
|
||||
$scheduled_queues = self::getScheduledQueues();
|
||||
$running_queues = self::getRunningQueues();
|
||||
|
Reference in New Issue
Block a user