Selaa lähdekoodia

update

master
dengbiao 5 päivää sitten
vanhempi
commit
85eb721ba6
3 muutettua tiedostoa jossa 5 lisäystä ja 5 poistoa
  1. +1
    -1
      internal/business/comm/service/svc_sys_cfg_get.go
  2. +1
    -1
      pkg/db/db.go
  3. +3
    -3
      pkg/rpc/rpc.go

+ 1
- 1
internal/business/comm/service/svc_sys_cfg_get.go Näytä tiedosto

@@ -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()


+ 1
- 1
pkg/db/db.go Näytä tiedosto

@@ -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,
})



+ 3
- 3
pkg/rpc/rpc.go Näytä tiedosto

@@ -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)
}


Ladataan…
Peruuta
Tallenna