wesmiler 2 år sedan
förälder
incheckning
84d8c0fade
1 ändrade filer med 9 tillägg och 8 borttagningar
  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()
     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');
             $date = date('Y-m-d H:i:s');
             $this->info("【{$date}】Socket:停止运行服务");
             $this->info("【{$date}】Socket:停止运行服务");
             $this->ws->close();
             $this->ws->close();