configuring the nats target to reconnect forever (#16050)

This commit is contained in:
Ray 2022-11-11 13:42:41 -07:00 committed by GitHub
parent bf89f79694
commit 66239f30ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -160,7 +160,7 @@ func (n NATSArgs) Validate() error {
// To obtain a nats connection from args.
func (n NATSArgs) connectNats() (*nats.Conn, error) {
connOpts := []nats.Option{nats.Name("Minio Notification")}
connOpts := []nats.Option{nats.Name("Minio Notification"), nats.MaxReconnects(-1)}
if n.Username != "" && n.Password != "" {
connOpts = append(connOpts, nats.UserInfo(n.Username, n.Password))
}