Skip to content

Commit

Permalink
Merge pull request #12 from hellofresh/hotfix/fix-bad-deployment
Browse files Browse the repository at this point in the history
Fix bad deployment
  • Loading branch information
rafaeljesus authored Mar 16, 2018
2 parents 1f6dfa6 + 5bb288c commit 8606da5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions checks/rabbitmq/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,27 +118,27 @@ func New(config Config) func() error {
}

func (c Config) defaults() {
if config.LogFunc == nil {
config.LogFunc = func(err error, details string, extra ...interface{}) {}
if c.LogFunc == nil {
c.LogFunc = func(err error, details string, extra ...interface{}) {}
}

if config.Exchange == "" {
config.Exchange = defaultExchange
if c.Exchange == "" {
c.Exchange = defaultExchange
}

if config.RoutingKey == "" {
if c.RoutingKey == "" {
host, err := os.Hostname()
if nil != err {
config.RoutingKey = "-unknown-"
c.RoutingKey = "-unknown-"
}
config.RoutingKey = host
c.RoutingKey = host
}

if config.Queue == "" {
config.Queue = fmt.Sprintf("%s.%s", config.Exchange, config.RoutingKey)
if c.Queue == "" {
c.Queue = fmt.Sprintf("%s.%s", c.Exchange, c.RoutingKey)
}

if config.ConsumeTimeout == 0 {
config.ConsumeTimeout = time.Second * 3
if c.ConsumeTimeout == 0 {
c.ConsumeTimeout = time.Second * 3
}
}

0 comments on commit 8606da5

Please sign in to comment.