mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-12 12:16:37 +08:00
修复添加用户后引起的编辑错误
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/go-gost/core/service"
|
||||
"github.com/go-gost/x/config"
|
||||
parser "github.com/go-gost/x/config/parsing/service"
|
||||
kill "github.com/go-gost/x/internal/util/port"
|
||||
"github.com/go-gost/x/registry"
|
||||
)
|
||||
|
||||
@@ -273,8 +274,14 @@ func pauseServices(req pauseServicesRequest) error {
|
||||
return errors.New(fmt.Sprintf("service %s configuration not found", stp.name))
|
||||
}
|
||||
|
||||
// 暂停服务
|
||||
// 使用和 updateService 相同的方法彻底断开所有连接
|
||||
stp.service.Close()
|
||||
registry.ServiceRegistry().Unregister(stp.name)
|
||||
|
||||
// 强制断开端口的所有连接
|
||||
if serviceConfig.Addr != "" {
|
||||
_ = kill.ForceClosePortConnections(serviceConfig.Addr)
|
||||
}
|
||||
|
||||
// 记录已暂停的服务
|
||||
pausedServices = append(pausedServices, struct {
|
||||
|
||||
@@ -341,14 +341,13 @@ func (w *WebSocketReporter) handleReceivedMessage(messageType int, message []byt
|
||||
|
||||
// routeCommand 路由命令到对应的处理函数
|
||||
func (w *WebSocketReporter) routeCommand(cmd CommandMessage) {
|
||||
//jsonBytes, errs := json.MarshalIndent(cmd, "", " ")
|
||||
//if errs != nil {
|
||||
// fmt.Println("Error marshaling JSON:", errs)
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//// 打印 JSON 字符串
|
||||
//fmt.Println("🔔 收到命令: ", string(jsonBytes))
|
||||
jsonBytes, errs := json.Marshal(cmd)
|
||||
if errs != nil {
|
||||
fmt.Println("Error marshaling JSON:", errs)
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println("🔔 收到命令: ", string(jsonBytes))
|
||||
var err error
|
||||
var response CommandResponse
|
||||
|
||||
|
||||
Reference in New Issue
Block a user