From a20734ca76638e48e38b4a8a1e997d27fe964600 Mon Sep 17 00:00:00 2001 From: withchao <993506633@qq.com> Date: Mon, 31 Jul 2023 11:59:09 +0800 Subject: [PATCH 1/2] test: zk event chan --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 1ab6323b3..e4adc8f8d 100644 --- a/go.mod +++ b/go.mod @@ -28,7 +28,7 @@ require ( require ( github.com/OpenIMSDK/protocol v0.0.1 - github.com/OpenIMSDK/tools v0.0.5 + github.com/OpenIMSDK/tools v0.0.6 github.com/redis/go-redis/v9 v9.0.5 ) diff --git a/go.sum b/go.sum index 19fb5da85..779cfcb7c 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/OpenIMSDK/open_utils v1.0.8 h1:IopxWgJwEF5ZAPsRuiZZOfcxNOQOCt/p8VDENc github.com/OpenIMSDK/open_utils v1.0.8/go.mod h1:FLoaQblWUVKQgqt2LrNzfSZLT6D3DICBn1kcOMDLUOI= github.com/OpenIMSDK/protocol v0.0.1 h1:Q6J1jCU00dfqmguxw2XI+IGcVfBAkb5Tz8LgvyeNkk0= github.com/OpenIMSDK/protocol v0.0.1/go.mod h1:F25dFrwrIx3lkNoiuf6FkCfxuwf8L4Z8UIsdTHP/r0Y= -github.com/OpenIMSDK/tools v0.0.5 h1:yBVHJ3EpIDcp8VFKPjuGr6MQvFa3t4JByZ+vmeC06/Q= -github.com/OpenIMSDK/tools v0.0.5/go.mod h1:eg+q4A34Qmu73xkY0mt37FHGMCMfC6CtmOnm0kFEGFI= +github.com/OpenIMSDK/tools v0.0.6 h1:aJuXHGyOltlGFPxro/EGr+RDFAN92sNqW1ObtykTgZM= +github.com/OpenIMSDK/tools v0.0.6/go.mod h1:eg+q4A34Qmu73xkY0mt37FHGMCMfC6CtmOnm0kFEGFI= github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 h1:iC9YFYKDGEy3n/FtqJnOkZsene9olVspKmkX5A2YBEo= github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4/go.mod h1:sCavSAvdzOjul4cEqeVtvlSaSScfNsTQ+46HwlTL1hc= github.com/alibabacloud-go/darabonba-openapi v0.1.18/go.mod h1:PB4HffMhJVmAgNKNq3wYbTUlFvPgxJpTzd1F5pTuUsc= From 1dc6af61de2087d069ad6465488b4549c8ffb536 Mon Sep 17 00:00:00 2001 From: withchao <993506633@qq.com> Date: Mon, 31 Jul 2023 14:40:34 +0800 Subject: [PATCH 2/2] fix: cpu usage exception --- cmd/api/admin_api/main.go | 6 ------ cmd/api/chat_api/main.go | 6 ------ cmd/rpc/admin/main.go | 8 -------- cmd/rpc/chat/main.go | 9 +-------- go.mod | 2 +- go.sum | 4 ++-- 6 files changed, 4 insertions(+), 31 deletions(-) diff --git a/cmd/api/admin_api/main.go b/cmd/api/admin_api/main.go index de21cb996..dff66cfd9 100644 --- a/cmd/api/admin_api/main.go +++ b/cmd/api/admin_api/main.go @@ -18,7 +18,6 @@ import ( "flag" "math/rand" "net" - "net/http" "strconv" "time" @@ -32,15 +31,10 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" - _ "net/http/pprof" - "github.com/gin-gonic/gin" ) func main() { - go func() { - _ = http.ListenAndServe(":6061", nil) - }() var configFile string flag.StringVar(&configFile, "config_folder_path", "../config/config.yaml", "Config full path") diff --git a/cmd/api/chat_api/main.go b/cmd/api/chat_api/main.go index 75b7951da..54d38a9fa 100644 --- a/cmd/api/chat_api/main.go +++ b/cmd/api/chat_api/main.go @@ -19,7 +19,6 @@ import ( "fmt" "math/rand" "net" - "net/http" "strconv" "time" @@ -33,15 +32,10 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" - _ "net/http/pprof" - "github.com/gin-gonic/gin" ) func main() { - go func() { - _ = http.ListenAndServe(":6062", nil) - }() var configFile string flag.StringVar(&configFile, "config_folder_path", "../config/config.yaml", "Config full path:") diff --git a/cmd/rpc/admin/main.go b/cmd/rpc/admin/main.go index c3a819aaf..93aab02dd 100644 --- a/cmd/rpc/admin/main.go +++ b/cmd/rpc/admin/main.go @@ -16,21 +16,14 @@ package main import ( "flag" - "net/http" - "github.com/OpenIMSDK/chat/pkg/common/chatrpcstart" "github.com/OpenIMSDK/tools/log" - _ "net/http/pprof" - "github.com/OpenIMSDK/chat/internal/rpc/admin" "github.com/OpenIMSDK/chat/pkg/common/config" ) func main() { - go func() { - _ = http.ListenAndServe(":6063", nil) - }() var configFile string flag.StringVar(&configFile, "config_folder_path", "../config/config.yaml", "Config full path") @@ -38,7 +31,6 @@ func main() { flag.IntVar(&rpcPort, "port", 30200, "get rpc ServerPort from cmd") - flag.Parse() if err := config.InitConfig(configFile); err != nil { panic(err) diff --git a/cmd/rpc/chat/main.go b/cmd/rpc/chat/main.go index 88aebcf28..886dfc92c 100644 --- a/cmd/rpc/chat/main.go +++ b/cmd/rpc/chat/main.go @@ -16,24 +16,17 @@ package main import ( "flag" - "net/http" - "github.com/OpenIMSDK/chat/pkg/common/chatrpcstart" "github.com/OpenIMSDK/tools/log" - _ "net/http/pprof" - "github.com/OpenIMSDK/chat/internal/rpc/chat" "github.com/OpenIMSDK/chat/pkg/common/config" ) func main() { - go func() { - _ = http.ListenAndServe(":6064", nil) - }() var configFile string flag.StringVar(&configFile, "config_folder_path", "../config/config.yaml", "Config full path") - + var rpcPort int flag.IntVar(&rpcPort, "port", 30300, "get rpc ServerPort from cmd") diff --git a/go.mod b/go.mod index e4adc8f8d..44a077ef6 100644 --- a/go.mod +++ b/go.mod @@ -28,7 +28,7 @@ require ( require ( github.com/OpenIMSDK/protocol v0.0.1 - github.com/OpenIMSDK/tools v0.0.6 + github.com/OpenIMSDK/tools v0.0.7 github.com/redis/go-redis/v9 v9.0.5 ) diff --git a/go.sum b/go.sum index 779cfcb7c..d5025dec6 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/OpenIMSDK/open_utils v1.0.8 h1:IopxWgJwEF5ZAPsRuiZZOfcxNOQOCt/p8VDENc github.com/OpenIMSDK/open_utils v1.0.8/go.mod h1:FLoaQblWUVKQgqt2LrNzfSZLT6D3DICBn1kcOMDLUOI= github.com/OpenIMSDK/protocol v0.0.1 h1:Q6J1jCU00dfqmguxw2XI+IGcVfBAkb5Tz8LgvyeNkk0= github.com/OpenIMSDK/protocol v0.0.1/go.mod h1:F25dFrwrIx3lkNoiuf6FkCfxuwf8L4Z8UIsdTHP/r0Y= -github.com/OpenIMSDK/tools v0.0.6 h1:aJuXHGyOltlGFPxro/EGr+RDFAN92sNqW1ObtykTgZM= -github.com/OpenIMSDK/tools v0.0.6/go.mod h1:eg+q4A34Qmu73xkY0mt37FHGMCMfC6CtmOnm0kFEGFI= +github.com/OpenIMSDK/tools v0.0.7 h1:4dQg1dGkoZrowen7LeaM+N9W/SsGsuYylU3KhuDXuwY= +github.com/OpenIMSDK/tools v0.0.7/go.mod h1:eg+q4A34Qmu73xkY0mt37FHGMCMfC6CtmOnm0kFEGFI= github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 h1:iC9YFYKDGEy3n/FtqJnOkZsene9olVspKmkX5A2YBEo= github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4/go.mod h1:sCavSAvdzOjul4cEqeVtvlSaSScfNsTQ+46HwlTL1hc= github.com/alibabacloud-go/darabonba-openapi v0.1.18/go.mod h1:PB4HffMhJVmAgNKNq3wYbTUlFvPgxJpTzd1F5pTuUsc=