1
0
Fork 0
mirror of https://github.com/postmannen/ctrl.git synced 2024-12-14 12:37:31 +00:00

set nats maxreconnects to unlimited

This commit is contained in:
postmannen 2021-05-21 13:33:03 +02:00
parent be8008b5a0
commit d9cd986426

View file

@ -102,7 +102,8 @@ func NewServer(c *Configuration) (*server, error) {
}
}
conn, err := nats.Connect(c.BrokerAddress, opt)
// Setting MaxReconnects to -1 which equals unlimited.
conn, err := nats.Connect(c.BrokerAddress, opt, nats.MaxReconnects(-1))
if err != nil {
er := fmt.Errorf("error: nats.Connect failed: %v", err)
return nil, er