add possibility to declare grpcOuterAddress from config, update default config
This commit is contained in:
1 parent
284a9bb444
commit
d4a44b0d72
2 files changed
+10
-8
No files matched your search
+3
-3
@@ -9,16 +9,16 @@ database:
|
||||
|
||||
moduleName: "config"
|
||||
grpcOuterAddress:
|
||||
ip: 127.0.0.1
|
||||
#ip: 127.0.0.1
|
||||
port: 9002
|
||||
|
||||
ws:
|
||||
rest:
|
||||
port: "9001"
|
||||
ip: "127.0.0.1"
|
||||
ip: "0.0.0.0"
|
||||
grpc:
|
||||
port: "9002"
|
||||
ip: "127.0.0.1"
|
||||
ip: "0.0.0.0"
|
||||
|
||||
metrics:
|
||||
gc: true
|
||||
|
||||
@@ -59,12 +59,14 @@ func main() {
|
||||
cfg := config.Get().(*conf.Configuration)
|
||||
handlers := helper.GetHandlers()
|
||||
endpoints := backend.GetEndpoints(cfg.ModuleName, handlers)
|
||||
address := cfg.WS.Grpc
|
||||
ip, err := getOutboundIp()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
address := cfg.GrpcOuterAddress
|
||||
if address.IP == "" {
|
||||
ip, err := getOutboundIp()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
address.IP = ip
|
||||
}
|
||||
address.IP = ip
|
||||
declaration := structure.BackendDeclaration{
|
||||
ModuleName: cfg.ModuleName,
|
||||
Version: version,
|
||||
|
||||
Reference in new issue
Block a user