Skip to content

Commit ce46f76

Browse files
gbird3Greg Bird
and
Greg Bird
authored
Add fatal log to onConnectionLost handler to respect terminate OnConnectError (#184)
Co-authored-by: Greg Bird <[email protected]>
1 parent 6abc1bb commit ce46f76

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/integration/mqtt/backend.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,9 @@ func (b *Backend) subscribeLoop() {
382382
}
383383

384384
func (b *Backend) onConnectionLost(c paho.Client, err error) {
385+
if b.terminateOnConnectError {
386+
log.Fatal(err)
387+
}
385388
mqttDisconnectCounter().Inc()
386389
log.WithError(err).Error("mqtt: connection error")
387390
}

0 commit comments

Comments
 (0)