try wait on proc
authorAlan <alan@roojs.com>
Thu, 12 Oct 2023 07:53:51 +0000 (15:53 +0800)
committerAlan <alan@roojs.com>
Thu, 12 Oct 2023 07:53:51 +0000 (15:53 +0800)
Notify.php

index 95b446a..5ca067b 100644 (file)
@@ -475,6 +475,9 @@ class Pman_Core_Notify extends Pman
         foreach($this->pool as $p) {
              
             //echo "CHECK PID: " . $p['pid'] . "\n";
+            
+            pcntl_waitpid($p['proc'], $status, WNOHANG);
+            
             $info =  proc_get_status($p['proc']);
             //var_dump($info);
             
@@ -522,7 +525,8 @@ class Pman_Core_Notify extends Pman
             //fclose($p['pipes'][1]);
             
             proc_close($p['proc']);
-            
+            proc_terminate($p['proc'], 9);
+
             
             //clearstatcache();
             //if (file_exists('/proc/'.$p['pid'])) {