Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: startup cpu usage is too high #85

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions cmd/api/admin_api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"flag"
"math/rand"
"net"
"net/http"
"strconv"
"time"

Expand All @@ -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")

Expand Down
6 changes: 0 additions & 6 deletions cmd/api/chat_api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"fmt"
"math/rand"
"net"
"net/http"
"strconv"
"time"

Expand All @@ -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:")

Expand Down
8 changes: 0 additions & 8 deletions cmd/rpc/admin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,21 @@ 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")

var rpcPort int

flag.IntVar(&rpcPort, "port", 30200, "get rpc ServerPort from cmd")


flag.Parse()
if err := config.InitConfig(configFile); err != nil {
panic(err)
Expand Down
9 changes: 1 addition & 8 deletions cmd/rpc/chat/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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.7
github.com/redis/go-redis/v9 v9.0.5
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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.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=
Expand Down
Loading