Notify.php
authorAlan Knowles <alan@roojs.com>
Mon, 29 Apr 2013 02:59:06 +0000 (10:59 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 29 Apr 2013 02:59:06 +0000 (10:59 +0800)
Notify.php

index 6769375..cb5e5a0 100644 (file)
@@ -203,6 +203,11 @@ class Pman_Core_Notify extends Pman
             echo "BATCH SIZE: ".  count($ar) . "\n";
             
             if (empty($ar)) {
+                if (empty($pushed)) {
+                    break;
+                }
+                $ar = $pushed;
+                $pushed = array();
                 break;
             }
             
@@ -214,17 +219,10 @@ class Pman_Core_Notify extends Pman
                 continue;
             }
             if ($this->poolHasDomain($p->person_id_email)) {
-                $ar[] = $p; // push it on the end..
-                if (in_array($p->person_id_email, $pushed)) {
-                    // it's been pushed to the end, and nothing has
-                    // been pushed since.s
-                    // give up, let the next run sort it out.
-                    sleep(3);
-                    continue;
-                }
+                
+                $pushed[] = $p;
                 
                 
-                echo "domain {$p->person_id_email} already on queue, pushing to end.\n";
                 //sleep(3);
                 continue;
             }
@@ -234,8 +232,6 @@ class Pman_Core_Notify extends Pman
             
             
             
-            $pushed = array();
-            
         }
         
         // we should have a time limit here...