wesmiler 2 лет назад
Родитель
Сommit
84d8c0fade
1 измененных файлов с 9 добавлено и 8 удалено
  1. 9 8
      app/Console/Commands/SocketServer.php

+ 9 - 8
app/Console/Commands/SocketServer.php

@@ -360,15 +360,16 @@ class SocketServer extends Command
      */
     public function stop()
     {
-        if ($this->ws) {
-            // 直接杀
-            $stoSh = base_path().'/crontab/socketStop.sh';
-            if(file_exists($stoSh) && function_exists('exec')){
-                exec("{$stoSh}");
-            }
+        // 直接杀
+        $stoSh = base_path().'/crontab/socketStop.sh';
+        if(file_exists($stoSh) && function_exists('exec')){
+            exec("{$stoSh}");
+        }
 
-            echo "$stoSh";
-            echo "socket stop...\n";
+        echo "$stoSh";
+        echo "socket stop...\n";
+
+        if ($this->ws) {
             $date = date('Y-m-d H:i:s');
             $this->info("【{$date}】Socket:停止运行服务");
             $this->ws->close();