- Recalculates the number of processed/to process subscribers if the

original count does not the current count from the database
This commit is contained in:
Vlad
2016-04-21 21:36:37 -04:00
parent 8e6ca502b3
commit 909ad86e33

View File

@@ -55,6 +55,12 @@ class SendingQueue {
$subscribers_ids) {
$subscribers = Subscriber::whereIn('id', $subscribers_ids)
->findArray();
// recalculate the number of subscribers if the total to process count
// does not match the number of subscribers in the database
if (count($subscribers_ids) !== count($subscribers)) {
$subscibers_to_exclude = array_diff($subscribers_ids, Helpers::arrayColumn($subscribers, 'id'));
$queue->subscribers->to_process = array_diff($queue->subscribers->to_process, $subscibers_to_exclude);
}
$queue->subscribers = call_user_func_array(
array(
$this,