Kaynağa Gözat

fix process title start_file missing

walkor 9 yıl önce
ebeveyn
işleme
9a9899e7b2
1 değiştirilmiş dosya ile 4 ekleme ve 2 silme
  1. 4 2
      Worker.php

+ 4 - 2
Worker.php

@@ -387,11 +387,13 @@ class Worker
      */
     protected static function init()
     {
+        // 记录启动入口
+        $backtrace = debug_backtrace();
+        self::$_startFile = $backtrace[count($backtrace)-1]['file'];
+        
         // 如果没设置$pidFile,则生成默认值
         if(empty(self::$pidFile))
         {
-            $backtrace = debug_backtrace();
-            self::$_startFile = $backtrace[count($backtrace)-1]['file'];
             self::$pidFile = __DIR__ . "/../".str_replace('/', '_', self::$_startFile).".pid";
         }
         // 没有设置日志文件,则生成一个默认值