Images.php
[Pman.Core] / Notify.php
index 5ca067b..5ed6a7b 100644 (file)
@@ -293,11 +293,14 @@ class Pman_Core_Notify extends Pman
             
             $black = $this->server->isBlacklisted($email);
             if ($black !== false) {
-                
+                $this->logecho("Blacklisted - try giving it to next server");
                 if (false === $this->server->updateNotifyToNextServer($p)) {
                     $ev = $this->addEvent('NOTIFY', $p, 'BLACKLISTED  FROM our DB');
-                    $this->server->updateNotifyToNextServer($w,  strtotime('NOW +  5 MINUTES'),true);
+                    // we dont have an althenative server to update it with.
+                    $this->logecho("Blacklisted - next server did not work - try again in 30 mins");
+                    $this->server->updateNotifyToNextServer($w,  date("Y-m-d H:i:s",  strtotime('NOW +  30 MINUTES')),true);
                    // $this->errorHandler( $ev->remarks);
+                   
                 }
                 
                 continue;
@@ -476,7 +479,6 @@ class Pman_Core_Notify extends Pman
              
             //echo "CHECK PID: " . $p['pid'] . "\n";
             
-            pcntl_waitpid($p['proc'], $status, WNOHANG);
             
             $info =  proc_get_status($p['proc']);
             //var_dump($info);
@@ -525,9 +527,13 @@ class Pman_Core_Notify extends Pman
             //fclose($p['pipes'][1]);
             
             proc_close($p['proc']);
-            proc_terminate($p['proc'], 9);
+             sleep(1);
+            clearstatcache();
+            if (file_exists('/proc/'. $p['pid'])) {
+                $this->logecho("proc PID={$p['pid']} still here - trying to wait");
+                pcntl_waitpid($p['pid'], $status, WNOHANG);
+            }
 
-            
             //clearstatcache();
             //if (file_exists('/proc/'.$p['pid'])) {
             //    $pool[] = $p;
@@ -606,6 +612,7 @@ class Pman_Core_Notify extends Pman
     function clearOld()
      {
           if ($this->server->isFirstServer()) {
+            
             $p = DB_DataObject::factory($this->table);
             $p->whereAdd("
                 sent < '2000-01-01'