Skip to content

Commit

Permalink
Update MailQueue.php
Browse files Browse the repository at this point in the history
  • Loading branch information
BBrunekreeft committed Jan 18, 2016
1 parent d1452ef commit 5077f79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions MailQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function process()

$success = true;

$items = Queue::find()->where(['and', ['sent_time' => NULL], ['<', 'attempts', $this->maxAttempts]])->orderBy(['created_at' => SORT_ASC])->limit($this->mailsPerRound)->all();
$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)->all();
// dd($items);
if(!empty($items)) {
foreach($items as $item) {
Expand All @@ -115,4 +115,4 @@ public function process()

return $success;
}
}
}

0 comments on commit 5077f79

Please sign in to comment.