From 46c4686969fc684c09f3d986518fc5fafc4ce120 Mon Sep 17 00:00:00 2001 From: Frank Filippone Date: Wed, 22 Mar 2023 20:41:41 +1100 Subject: [PATCH] Check connection status on Channel failure --- example_client_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/example_client_test.go b/example_client_test.go index 2c8d6d7..d285a34 100644 --- a/example_client_test.go +++ b/example_client_test.go @@ -204,6 +204,9 @@ func (client *Client) handleReInit(conn *amqp.Connection) bool { select { case <-client.done: return true + case <-client.notifyConnClose: + client.logger.Println("Connection closed. Reconnecting...") + return false case <-time.After(reInitDelay): } continue