DataObjects/Core_notify_recur.php
[Pman.Core] / Notify.php
index 4ebde1f..b564f4a 100644 (file)
@@ -322,7 +322,6 @@ class Pman_Core_Notify extends Pman
         }
         $cmd = 'exec ' . $php . ' ' . $app . ' ' . $cmdOpts; //. ' &';
         
-        print_R($cmd);exit;
        
         $pipe = array();
         $this->logecho("call proc_open $cmd");
@@ -353,6 +352,7 @@ class Pman_Core_Notify extends Pman
                 'cmd' => $cmd,
                 'email' => $email,
                 'pipes' => $pipes,
+                'notify_id' => $id,
                 'started' => time()
             
                 
@@ -393,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;
                 }