diff --git a/internal/business/comm/service/svc_sys_cfg_get.go b/internal/business/comm/service/svc_sys_cfg_get.go index bd532d4..1a2ed25 100644 --- a/internal/business/comm/service/svc_sys_cfg_get.go +++ b/internal/business/comm/service/svc_sys_cfg_get.go @@ -21,7 +21,7 @@ func SysCfgFind(keys ...string) map[string]string { // SysCfgFindComm get cfg by master id func SysCfgFindComm(keys ...string) map[string]string { res := map[string]string{} - cfgKey := fmt.Sprintf("egg_im_cfg_cache") + cfgKey := fmt.Sprintf(md.KEY_SYS_CFG_CACHE) err := db2.RedisUtil.GetJson(cfgKey, &res) if err != nil || len(res) == 0 { cfgList, _ := db.DbSysCfg.SysCfgGetAll() diff --git a/pkg/db/db.go b/pkg/db/db.go index 319a8f8..070b48e 100644 --- a/pkg/db/db.go +++ b/pkg/db/db.go @@ -41,7 +41,7 @@ func InitRedis(addr, password string) { logger.Logger.Info("init redis") RedisCli = redis.NewClient(&redis.Options{ Addr: addr, - DB: 0, + DB: 1, //TODO::IM统一放1号库 Password: password, }) diff --git a/pkg/rpc/rpc.go b/pkg/rpc/rpc.go index d028395..6d847fb 100644 --- a/pkg/rpc/rpc.go +++ b/pkg/rpc/rpc.go @@ -58,10 +58,10 @@ func initConnectIntClient() { } func initBusinessIntClient() { - //conn, err := grpc.DialContext(context.TODO(), "127.0.0.1:8000", grpc.WithInsecure(), - // grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"LoadBalancingPolicy": "%s"}`, roundrobin.Name))) - conn, err := grpc.DialContext(context.TODO(), k8s.GetK8STarget("egg-im", "business", "8000"), grpc.WithInsecure(), + conn, err := grpc.DialContext(context.TODO(), "127.0.0.1:8000", grpc.WithInsecure(), grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"LoadBalancingPolicy": "%s"}`, roundrobin.Name))) + //conn, err := grpc.DialContext(context.TODO(), k8s.GetK8STarget("egg-im", "business", "8000"), grpc.WithInsecure(), + // grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"LoadBalancingPolicy": "%s"}`, roundrobin.Name))) if err != nil { panic(err) }