Skip to content

Commit

Permalink
change Nats Health policy to Status() != CONNECTED
Browse files Browse the repository at this point in the history
  • Loading branch information
lghinet committed Mar 22, 2022
1 parent 401e8da commit c06feea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/injector/pod_patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const (
sidecarHealthzPath = "healthz"
defaultHealthzProbeDelaySeconds = 3
defaultHealthzProbeTimeoutSeconds = 3
defaultHealthzProbePeriodSeconds = 10
defaultHealthzProbePeriodSeconds = 15
defaultHealthzProbeThreshold = 3
trueString = "true"
)
Expand Down
3 changes: 1 addition & 2 deletions pkg/messaging/nats/nats.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,7 @@ func (n *natsStreamingPubSub) IsHealthy(ctx context.Context) healthcheck.HealthR
if n.closed ||
n.natStreamingConn == nil ||
n.natStreamingConn.NatsConn() == nil ||
n.natStreamingConn.NatsConn().Status() == nats.CLOSED ||
n.natStreamingConn.NatsConn().Status() == nats.DISCONNECTED {
n.natStreamingConn.NatsConn().Status() != nats.CONNECTED {
return healthcheck.HealthResult{
Status: healthcheck.Unhealthy,
Description: "nats pubsub connection is closed",
Expand Down

0 comments on commit c06feea

Please sign in to comment.