Browse Source

修改远程调用地址,增加配置判断

master v0.3.0
guzeng 1 year ago
parent
commit
5326293550
1 changed files with 8 additions and 3 deletions
  1. +8
    -3
      common.go

+ 8
- 3
common.go View File

@ -152,11 +152,16 @@ const CHANNEL_ORDER_ASKPAY_QUEUE = "channel_order_askpay_queue"
func rpc_server_conn(url ...string) (*RabbitmqServiceClient, error) {
var wx_rpc_url string = "127.0.0.1:7955"
var rpc_url string
if len(url) > 0 && url[0] != "" {
wx_rpc_url = url[0]
rpc_url = url[0]
} else if conf.RABBITMQ_RPC_URL != "" {
rpc_url = conf.RABBITMQ_RPC_URL
} else {
rpc_url = "127.0.0.1:" + conf.RABBITMQ_RPC_PORT
}
conn, _, err := DialRabbitmqService("tcp", wx_rpc_url)
conn, _, err := DialRabbitmqService("tcp", rpc_url)
if err != nil {
return nil, err
}


Loading…
Cancel
Save