Skip to content

Commit

Permalink
Correct port check order
Browse files Browse the repository at this point in the history
  • Loading branch information
bajb committed Aug 18, 2017
1 parent 18ad5c9 commit 06d70c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ func (app *Application) GetServiceConnection(service string, opts ...grpc.DialOp
func (app *Application) getEnvLocation(prefix string, service string) string {
service = strings.Replace(service, "-", "_", -1)
serviceHost := os.Getenv(strings.ToUpper(prefix+service) + EnvServiceHostSuffix)
servicePort := os.Getenv(strings.ToUpper(prefix+service) + EnvServicePortSuffix)
servicePort := os.Getenv(strings.ToUpper(prefix+service) + EnvServicePortSuffix + "_GRPC")
if servicePort == "" {
servicePort = os.Getenv(strings.ToUpper(prefix+service) + EnvServicePortSuffix + "_GRPC")
servicePort = os.Getenv(strings.ToUpper(prefix+service) + EnvServicePortSuffix + "_DEFAULTPORT")
}
if servicePort == "" {
servicePort = os.Getenv(strings.ToUpper(prefix+service) + EnvServicePortSuffix + "_DEFAULTPORT")
servicePort = os.Getenv(strings.ToUpper(prefix+service) + EnvServicePortSuffix)
}
if serviceHost+servicePort != "" {
return serviceHost + ":" + servicePort
Expand Down

0 comments on commit 06d70c9

Please sign in to comment.