Select users in batches instead of 'all at once' when sending NLs
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Mon, 31 Jan 2011 23:44:34 +0000 (00:44 +0100)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Mon, 31 Jan 2011 23:44:34 +0000 (00:44 +0100)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
include/newsletter.inc.php

index 6a86929..1f42a2d 100644 (file)
@@ -1075,11 +1075,12 @@ class NLIssue
 
         $ufc = new PFC_And($this->getRecipientsUFC(), new UFC_NLSubscribed($this->nl->id, $this->id), new UFC_HasEmailRedirect());
         $emailsCount = 0;
-        $uf = new UserFilter($ufc, new PlLimit(self::BATCH_SIZE));
+        $uf = new UserFilter($ufc);
+        $limit = new PlLimit(self::BATCH_SIZE);
 
         while (true) {
             $sent = array();
-            $users = $uf->getUsers();
+            $users = $uf->getUsers($limit);
             if (count($users) == 0) {
                 return $emailsCount;
             }