fix run, add connection check
This commit is contained in:
+4
-4
@@ -17,12 +17,13 @@ package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"it2000.com.cn/tele-recv/utils"
|
||||
"log"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
|
||||
"it2000.com.cn/tele-recv/utils"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
@@ -41,8 +42,6 @@ to quickly create a Cobra application.`,
|
||||
},
|
||||
}
|
||||
|
||||
var run bool
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(startCmd)
|
||||
|
||||
@@ -77,7 +76,8 @@ func start() {
|
||||
sig := <-sigs
|
||||
fmt.Println()
|
||||
fmt.Println(sig)
|
||||
run = false
|
||||
utils.ServerRunning = false
|
||||
utils.StopSocketServer()
|
||||
done <- true
|
||||
}()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user