File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
crates/extensions/tedge_mqtt_bridge/src Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -347,18 +347,17 @@ impl<'a> BridgeHealth<'a> {
347
347
) {
348
348
let name = self . name ;
349
349
let ( err, health_payload) = match result {
350
- Ok ( _) => {
351
- info ! ( "MQTT bridge connected to {name} broker" ) ;
352
- ( None , MQTT_BRIDGE_UP_PAYLOAD )
353
- }
354
- Err ( err) => {
355
- error ! ( "MQTT bridge failed to connect to {name} broker: {err}" ) ;
356
- ( Some ( err. to_string ( ) ) , MQTT_BRIDGE_DOWN_PAYLOAD )
357
- }
350
+ Ok ( _) => ( None , MQTT_BRIDGE_UP_PAYLOAD ) ,
351
+ Err ( err) => ( Some ( err. to_string ( ) ) , MQTT_BRIDGE_DOWN_PAYLOAD ) ,
358
352
} ;
359
353
360
354
if self . last_err != err {
355
+ match & err {
356
+ None => info ! ( "MQTT bridge connected to {name} broker" ) ,
357
+ Some ( err) => error ! ( "MQTT bridge failed to connect to {name} broker: {err}" ) ,
358
+ }
361
359
self . last_err = err;
360
+
362
361
if let Some ( health_topic) = & self . health_topic {
363
362
self . target
364
363
. publish ( health_topic, QoS :: AtLeastOnce , true , health_payload)
You can’t perform that action at this time.
0 commit comments