Fix acceptance tests, update counters [MAILPOET-903]
This commit is contained in:
@ -166,12 +166,15 @@ class Newsletters extends APIEndpoint {
|
||||
// if there are past due notifications, reschedule them for the next send date
|
||||
if($newsletter->type === Newsletter::TYPE_NOTIFICATION && $status === Newsletter::STATUS_ACTIVE) {
|
||||
$next_run_date = Scheduler::getNextRunDate($newsletter->schedule);
|
||||
$newsletter->queue()->findOne()->task()
|
||||
->whereLte('scheduled_at', Carbon::createFromTimestamp(current_time('timestamp')))
|
||||
->where('status', SendingQueue::STATUS_SCHEDULED)
|
||||
->findResultSet()
|
||||
->set('scheduled_at', $next_run_date)
|
||||
->save();
|
||||
$queue = $newsletter->queue()->findOne();
|
||||
if($queue) {
|
||||
$queue->task()
|
||||
->whereLte('scheduled_at', Carbon::createFromTimestamp(current_time('timestamp')))
|
||||
->where('status', SendingQueue::STATUS_SCHEDULED)
|
||||
->findResultSet()
|
||||
->set('scheduled_at', $next_run_date)
|
||||
->save();
|
||||
}
|
||||
}
|
||||
|
||||
return $this->successResponse(
|
||||
|
Reference in New Issue
Block a user