Replace multiple subscriber update queries with one in sending loop
[MAILPOET-5178]
This commit is contained in:
committed by
Aschepikov
parent
764114edc7
commit
5d88f02216
@@ -37,11 +37,13 @@ class Subscribers {
|
||||
|
||||
public function updateProcessedSubscribers(array $processedSubscribers) {
|
||||
if (!empty($processedSubscribers)) {
|
||||
$this->getSubscribers()
|
||||
->whereIn('subscriber_id', $processedSubscribers)
|
||||
->findResultSet()
|
||||
->set('processed', ScheduledTaskSubscriber::STATUS_PROCESSED)
|
||||
->save();
|
||||
ScheduledTaskSubscriber::rawExecute(sprintf(
|
||||
'UPDATE %1$s SET processed = %2$s WHERE task_id = %3$s AND subscriber_id IN (%4$s)',
|
||||
ScheduledTaskSubscriber::$_table,
|
||||
ScheduledTaskSubscriber::STATUS_PROCESSED,
|
||||
$this->task->id,
|
||||
join(', ', array_map('intval', $processedSubscribers))
|
||||
));
|
||||
}
|
||||
$this->checkCompleted();
|
||||
}
|
||||
|
Reference in New Issue
Block a user