From 7e2463851a45628e2b7ff37c58953395bb00ab57 Mon Sep 17 00:00:00 2001 From: Joshua Powers Date: Wed, 31 Jul 2024 13:34:44 -0600 Subject: [PATCH] fix(inputs.opcua): Reconnect if closed connection (#15696) (cherry picked from commit b090cf621cae1787d1d01b3b53982e405f9ed359) --- plugins/inputs/opcua/read_client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/inputs/opcua/read_client.go b/plugins/inputs/opcua/read_client.go index b6f2a0d5a2b61..b765ff72d1c13 100644 --- a/plugins/inputs/opcua/read_client.go +++ b/plugins/inputs/opcua/read_client.go @@ -91,7 +91,7 @@ func (o *ReadClient) Connect() error { } func (o *ReadClient) ensureConnected() error { - if o.State() == opcua.Disconnected { + if o.State() == opcua.Disconnected || o.State() == opcua.Closed { return o.Connect() } return nil