ソースを参照

Update Worker.php

walkor 5 年 前
コミット
9e2a85e7e9
1 ファイル変更4 行追加1 行削除
  1. 4 1
      Worker.php

+ 4 - 1
Worker.php

@@ -615,7 +615,7 @@ class Worker
     protected static function lock()
     {
         $fd = \fopen(static::$_startFile, 'r');
-        if (!$fd || !flock($fd, LOCK_EX)) {
+        if ($fd && !flock($fd, LOCK_EX)) {
             static::log('Workerman['.static::$_startFile.'] already running.');
             exit;
         }
@@ -2142,6 +2142,9 @@ class Worker
             return false;
         }
         $stat = \fstat($stream);
+        if (!$stat) {
+            return false;
+        }
         if (($stat['mode'] & 0170000) === 0100000) {
             // file
             static::$_outputDecorated = false;