mirror of https://github.com/minio/minio.git
Adding error check for jetstream connection (#15252)
This commit is contained in:
parent
cf9e3069f2
commit
3bdb92fcad
|
@ -256,10 +256,12 @@ func (target *NATSTarget) IsActive() (bool, error) {
|
||||||
|
|
||||||
if target.natsConn != nil && target.args.JetStream.Enable {
|
if target.natsConn != nil && target.args.JetStream.Enable {
|
||||||
target.jstream, connErr = target.natsConn.JetStream()
|
target.jstream, connErr = target.natsConn.JetStream()
|
||||||
if connErr.Error() == nats.ErrNoServers.Error() {
|
if connErr != nil {
|
||||||
return false, errNotConnected
|
if connErr.Error() == nats.ErrNoServers.Error() {
|
||||||
|
return false, errNotConnected
|
||||||
|
}
|
||||||
|
return false, connErr
|
||||||
}
|
}
|
||||||
return false, connErr
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true, nil
|
return true, nil
|
||||||
|
|
Loading…
Reference in New Issue