Skip to content

Commit

Permalink
Merge pull request #46 from necrox87/patch-3
Browse files Browse the repository at this point in the history
Revert broken pull request #30
  • Loading branch information
nterms committed Nov 26, 2018
2 parents 85a7259 + d8f0b55 commit 8acfbda
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions MailQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}
}

/**
Expand All @@ -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);
Expand Down

0 comments on commit 8acfbda

Please sign in to comment.