Skip to content

Commit

Permalink
Merge pull request #293 from jzding/fix-consumer-publisher
Browse files Browse the repository at this point in the history
Avoid failure when sending req to unavailable publisher at consumer
  • Loading branch information
openshift-merge-bot[bot] authored Mar 13, 2024
2 parents 51b5381 + 73dc724 commit 81c1e82
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,12 +422,11 @@ RETRY:
if th.URI != nil {
s = th.URI.String()
th.URI.Path = path.Join(th.URI.Path, "health")
if ok, _ := common.HTTPTransportHealthCheck(th.URI, 2*time.Second); ok {
log.Infof("Registering publisher %s", s)
httpServer.RegisterPublishers(types.ParseURI(s))
} else {
log.Errorf("health check failed, skipping registration for %s", s)
if ok, _ := common.HTTPTransportHealthCheck(th.URI, 2*time.Second); !ok {
log.Warningf("health check failed for transport %s", s)
}
log.Infof("Registering publisher %s", s)
httpServer.RegisterPublishers(types.ParseURI(s))
} else {
log.Errorf("failed to parse publisher url %s", s)
}
Expand Down

0 comments on commit 81c1e82

Please sign in to comment.