Skip to content

Commit

Permalink
Merge pull request #159 from Revolyssup/panic
Browse files Browse the repository at this point in the history
fix panic from Meshkit err
  • Loading branch information
Revolyssup authored Oct 7, 2022
2 parents 7873119 + f339192 commit 427ea15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@ func main() {
for {
urls := strings.Split(config.BrokerURL, ":")
if len(urls) == 0 {
log.Error(err)
log.Info("invalid URL")
os.Exit(1)
}
pingURL := "http://" + urls[0] + pingEndpoint
resp, err := http.Get(pingURL) //remove nats port and use status port for ping
if err != nil {
log.Error(err)
log.Info("could not connect to broker: " + err.Error() + " retrying...")
continue
}
if resp.StatusCode == http.StatusOK {
break
}
log.Error(fmt.Errorf("could not ping broker at: "+pingURL, " retrying..."))
log.Error(fmt.Errorf("could not recieve OK response from broker: "+pingURL, " retrying..."))
time.Sleep(1 * time.Second)
}

Expand Down

0 comments on commit 427ea15

Please sign in to comment.