From 57a655a7085d41af4a8ea3b77d5bce2ec2d5d4cc Mon Sep 17 00:00:00 2001 From: bandl <1658002533@qq.com> Date: Fri, 15 Oct 2021 22:35:16 +0800 Subject: [PATCH] feat(storage): update conf --- storage/cmd/root.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/storage/cmd/root.go b/storage/cmd/root.go index e011f95..b4c00f4 100644 --- a/storage/cmd/root.go +++ b/storage/cmd/root.go @@ -3,14 +3,16 @@ package cmd import ( "fmt" - "gitee.com/timedb/wheatCache/storage/server/single" "log" "net" "os" "os/signal" "syscall" + "gitee.com/timedb/wheatCache/storage/server/single" + _ "gitee.com/timedb/wheatCache/conf" + "gitee.com/timedb/wheatCache/pkg/logx" "gitee.com/timedb/wheatCache/pkg/proto" "github.com/spf13/cobra" "github.com/spf13/viper" @@ -25,7 +27,6 @@ var rootCmd = &cobra.Command{ Long: `start storage server`, Run: func(cmd *cobra.Command, args []string) { storageServer := single.NewServer() - // 先写死, 等配置文件 conf := viper.GetStringMap("storage") host := conf["host"].(string) port := conf["port"].(int) @@ -37,7 +38,7 @@ var rootCmd = &cobra.Command{ listen, err := net.ListenTCP("tcp", tcpAddr) if err != nil { - log.Panicln(err) + logx.Panicln(err) } s := grpc.NewServer() proto.RegisterCommServerServer(s, storageServer)