mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-08 11:05:59 +08:00
Merge branch 'errcode' of github.com:OpenIMSDK/Open-IM-Server into errcode
# Conflicts: # cmd/cmdutils/main.go
This commit is contained in:
+9
-3
@@ -5,10 +5,11 @@ import (
|
||||
"OpenIM/pkg/common/cmd"
|
||||
"OpenIM/pkg/common/config"
|
||||
"OpenIM/pkg/common/log"
|
||||
"OpenIM/pkg/common/mw"
|
||||
"fmt"
|
||||
"github.com/OpenIMSDK/openKeeper"
|
||||
"github.com/spf13/cobra"
|
||||
"os"
|
||||
|
||||
"strconv"
|
||||
|
||||
"OpenIM/pkg/common/constant"
|
||||
@@ -40,14 +41,19 @@ func run(port int) error {
|
||||
if port == 0 {
|
||||
port = config.Config.Api.GinPort[0]
|
||||
}
|
||||
zk, err := openKeeper.NewClient(nil, "", 10, "", "")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.NewPrivateLog(constant.LogFileName)
|
||||
router := api.NewGinRouter()
|
||||
zk.AddOption(mw.GrpcClient())
|
||||
router := api.NewGinRouter(zk)
|
||||
address := constant.LocalHost + ":" + strconv.Itoa(port)
|
||||
if config.Config.Api.ListenIP != "" {
|
||||
address = config.Config.Api.ListenIP + ":" + strconv.Itoa(port)
|
||||
}
|
||||
fmt.Println("start api server, address: ", address, ", OpenIM version: ", constant.CurrentVersion)
|
||||
err := router.Run(address)
|
||||
err = router.Run(address)
|
||||
if err != nil {
|
||||
log.Error("", "api run failed ", address, err.Error())
|
||||
return err
|
||||
|
||||
@@ -3,8 +3,6 @@ package main
|
||||
import (
|
||||
"OpenIM/internal/tools"
|
||||
"OpenIM/pkg/common/cmd"
|
||||
"OpenIM/pkg/common/config"
|
||||
"OpenIM/pkg/common/constant"
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
func main() {
|
||||
fmt.Println(time.Now(), "start cronTask")
|
||||
if err := config.InitConfig(); err != nil {
|
||||
if err := config.InitConfig(""); err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
if err := tools.StartCronTask(); err != nil {
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
if err := config.InitConfig(); err != nil {
|
||||
if err := config.InitConfig(""); err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
log.NewPrivateLog(constant.LogFileName)
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
if err := config.InitConfig(); err != nil {
|
||||
if err := config.InitConfig(""); err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
var wg sync.WaitGroup
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
if err := config.InitConfig(); err != nil {
|
||||
if err := config.InitConfig(""); err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
if err := startrpc.Start(config.Config.RpcPort.OpenImAuthPort[0], config.Config.RpcRegisterName.OpenImAuthName, config.Config.Prometheus.AuthPrometheusPort[0], auth.Start); err != nil {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
if err := config.InitConfig(); err != nil {
|
||||
if err := config.InitConfig(""); err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
if err := startrpc.Start(config.Config.RpcPort.OpenImConversationPort[0], config.Config.RpcRegisterName.OpenImConversationName, config.Config.Prometheus.ConversationPrometheusPort[0], conversation.Start); err != nil {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
if err := config.InitConfig(); err != nil {
|
||||
if err := config.InitConfig(""); err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
if err := startrpc.Start(config.Config.RpcPort.OpenImFriendPort[0], config.Config.RpcRegisterName.OpenImFriendName, config.Config.Prometheus.FriendPrometheusPort[0], friend.Start); err != nil {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
if err := config.InitConfig(); err != nil {
|
||||
if err := config.InitConfig(""); err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
if err := startrpc.Start(config.Config.RpcPort.OpenImGroupPort[0], config.Config.RpcRegisterName.OpenImGroupName, config.Config.Prometheus.GroupPrometheusPort[0], group.Start); err != nil {
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
if err := config.InitConfig(); err != nil {
|
||||
if err := config.InitConfig(""); err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
if err := startrpc.Start(config.Config.RpcPort.OpenImMessagePort[0], config.Config.RpcRegisterName.OpenImMsgName, config.Config.Prometheus.AuthPrometheusPort[0], msg.Start); err != nil {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
if err := config.InitConfig(); err != nil {
|
||||
if err := config.InitConfig(""); err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
if err := startrpc.Start(config.Config.RpcPort.OpenImThirdPort[0], config.Config.RpcRegisterName.OpenImThirdName, config.Config.Prometheus.ThirdPrometheusPort[0], third.Start); err != nil {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
if err := config.InitConfig(); err != nil {
|
||||
if err := config.InitConfig(""); err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
if err := startrpc.Start(config.Config.RpcPort.OpenImUserPort[0], config.Config.RpcRegisterName.OpenImUserName, config.Config.Prometheus.UserPrometheusPort[0], user.Start); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user