Add a limit to fetch 5 scheduled tasks at a time [MAILPOET-1366]

This commit is contained in:
Tautvidas Sipavičius
2018-05-02 23:27:30 +03:00
parent 576796db22
commit a588e95762
7 changed files with 94 additions and 15 deletions

View File

@ -21,6 +21,7 @@ class SendingQueue {
public $newsletter_task;
public $timer;
const BATCH_SIZE = 20;
const TASK_BATCH_SIZE = 5;
function __construct($timer = false, $mailer_task = false, $newsletter_task = false) {
$this->mailer_task = ($mailer_task) ? $mailer_task : new MailerTask();
@ -195,6 +196,6 @@ class SendingQueue {
}
static function getRunningQueues() {
return SendingTask::getRunningQueues();
return SendingTask::getRunningQueues(self::TASK_BATCH_SIZE);
}
}
}