From a3fcb74f939e5f143cc3f175d183bc8eaf1b1361 Mon Sep 17 00:00:00 2001 From: Shannon Wynter Date: Mon, 3 Sep 2018 09:15:45 +1000 Subject: [PATCH] Make nats reusable after disconnection --- nats.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nats.go b/nats.go index 70d8891..49c07ec 100644 --- a/nats.go +++ b/nats.go @@ -85,7 +85,7 @@ func setAddrs(addrs []string) []string { } func (n *nbroker) Connect() error { - if n.conn != nil { + if n.conn != nil && n.conn.IsConnected() { return nil }