Skip to content

Commit

Permalink
Merge ad07dbf into 605883e
Browse files Browse the repository at this point in the history
  • Loading branch information
ChuntaoLu committed Mar 1, 2019
2 parents 605883e + ad07dbf commit 1903f3b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions runtime/gateway.go
Expand Up @@ -61,8 +61,10 @@ var levelMap = map[string]zapcore.Level{
var defaultShutdownPollInterval = 500 * time.Millisecond
var defaultCloseTimeout = 10000 * time.Millisecond

const localhost = "127.0.0.1"
const prod = "production"
const (
localhost = "127.0.0.1"
testenv = "test"
)

// Options configures the gateway
type Options struct {
Expand Down Expand Up @@ -213,7 +215,7 @@ func (gateway *Gateway) Bootstrap() error {
gateway.Logger.Error("Error listening on port", zap.Error(err))
return errors.Wrap(err, "error listening on port")
}
if gateway.localHTTPServer.RealIP != gateway.httpServer.RealIP && env == prod {
if gateway.localHTTPServer.RealIP != gateway.httpServer.RealIP && env != testenv {
_, err := gateway.httpServer.JustListen()
if err != nil {
gateway.Logger.Error("Error listening on port", zap.Error(err))
Expand All @@ -236,7 +238,7 @@ func (gateway *Gateway) Bootstrap() error {

// start TChannel server
ip := localhost
if env == prod {
if env != testenv {
tchannelIP, err := tchannel.ListenIP()
if err != nil {
return errors.Wrap(err, "error finding the best IP for tchannel")
Expand Down

0 comments on commit 1903f3b

Please sign in to comment.