DataObjects/Core_person_signup.php
[Pman.Core] / Notify.php
index 9eb892a..b564f4a 100644 (file)
@@ -170,7 +170,7 @@ class Pman_Core_Notify extends Pman
             
         }
      
-        DB_DataObject::debugLevel(1);
+        //DB_DataObject::debugLevel(1);
         $w = DB_DataObject::factory($this->table);
         
         if (!empty($opts['old'])) {
@@ -205,7 +205,7 @@ class Pman_Core_Notify extends Pman
         
         
         $ar = $w->fetchAll();
-        print_r($ar);exit;
+        
         if (!empty($opts['list'])) {
             if (empty($ar)) {
                 die("Nothing in Queue\n");
@@ -352,6 +352,7 @@ class Pman_Core_Notify extends Pman
                 'cmd' => $cmd,
                 'email' => $email,
                 'pipes' => $pipes,
+                'notify_id' => $id,
                 'started' => time()
             
                 
@@ -392,6 +393,14 @@ class Pman_Core_Notify extends Pman
                     $this->logecho("TERMINATING: ({$p['pid']}) " . $p['cmd'] . " : " . file_get_contents($p['out']));
                     @unlink($p['out']);
                     
+                    $w = DB_DataObject::factory($this->table);
+                    $w->get($p['notify_id']);
+                    $ww = clone($w);
+                    $this->addEvent('NOTIFY', $w, 'TERMINATED - TIMEOUT');
+                    $w->act_when = date('Y-m-d H:i:s', strtotime('NOW + 30  MINUTES'));
+                    $w->update($ww);
+                    
+                    
                     continue;
                 }