1
0
mirror of https://github.com/minio/minio.git synced 2025-04-03 19:30:29 -04:00

Adding error check for jetstream connection ()

This commit is contained in:
Ray 2022-07-08 00:14:47 -06:00 committed by GitHub
parent cf9e3069f2
commit 3bdb92fcad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -256,11 +256,13 @@ 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 != nil {
if connErr.Error() == nats.ErrNoServers.Error() { if connErr.Error() == nats.ErrNoServers.Error() {
return false, errNotConnected return false, errNotConnected
} }
return false, connErr return false, connErr
} }
}
return true, nil return true, nil
} }