From d8f0b5521719271077ba6d8f83e9d7193e391496 Mon Sep 17 00:00:00 2001 From: Marco Germani Date: Mon, 26 Nov 2018 11:37:11 +0100 Subject: [PATCH] Revert broken pull request #30 Revert broken pull request #30 --- MailQueue.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MailQueue.php b/MailQueue.php index 819a4b4..ee8c301 100644 --- a/MailQueue.php +++ b/MailQueue.php @@ -82,10 +82,6 @@ class MailQueue extends Mailer public function init() { parent::init(); - - if (Yii::$app->db->getTableSchema($this->table) == null) { - throw new \yii\base\InvalidConfigException('"' . $this->table . '" not found in database. Make sure the db migration is properly done and the table is created.'); - } } /** @@ -95,6 +91,10 @@ public function init() */ public function process() { + if (Yii::$app->db->getTableSchema($this->table) == null) { + throw new \yii\base\InvalidConfigException('"' . $this->table . '" not found in database. Make sure the db migration is properly done and the table is created.'); + } + $success = true; $items = Queue::find()->where(['and', ['sent_time' => NULL], ['<', 'attempts', $this->maxAttempts], ['<=', 'time_to_send', date('Y-m-d H:i:s')]])->orderBy(['created_at' => SORT_ASC])->limit($this->mailsPerRound);