@@ -21,7 +21,7 @@ func SysCfgFind(keys ...string) map[string]string { | |||||
// SysCfgFindComm get cfg by master id | // SysCfgFindComm get cfg by master id | ||||
func SysCfgFindComm(keys ...string) map[string]string { | func SysCfgFindComm(keys ...string) map[string]string { | ||||
res := 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) | err := db2.RedisUtil.GetJson(cfgKey, &res) | ||||
if err != nil || len(res) == 0 { | if err != nil || len(res) == 0 { | ||||
cfgList, _ := db.DbSysCfg.SysCfgGetAll() | cfgList, _ := db.DbSysCfg.SysCfgGetAll() | ||||
@@ -41,7 +41,7 @@ func InitRedis(addr, password string) { | |||||
logger.Logger.Info("init redis") | logger.Logger.Info("init redis") | ||||
RedisCli = redis.NewClient(&redis.Options{ | RedisCli = redis.NewClient(&redis.Options{ | ||||
Addr: addr, | Addr: addr, | ||||
DB: 0, | |||||
DB: 1, //TODO::IM统一放1号库 | |||||
Password: password, | Password: password, | ||||
}) | }) | ||||
@@ -58,10 +58,10 @@ func initConnectIntClient() { | |||||
} | } | ||||
func initBusinessIntClient() { | 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))) | 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 { | if err != nil { | ||||
panic(err) | panic(err) | ||||
} | } | ||||