fix(inputs.opcua): Reconnect if closed connection (#15696)
This commit is contained in:
parent
a978110b2c
commit
b090cf621c
|
|
@ -91,7 +91,7 @@ func (o *ReadClient) Connect() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *ReadClient) ensureConnected() error {
|
func (o *ReadClient) ensureConnected() error {
|
||||||
if o.State() == opcua.Disconnected {
|
if o.State() == opcua.Disconnected || o.State() == opcua.Closed {
|
||||||
return o.Connect()
|
return o.Connect()
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue