Manager Cleanup: consistent variable name for MQTTClient receiver pointer

No functional changes.
This commit is contained in:
Sybren A. Stüvel 2024-02-04 17:03:38 +01:00
parent 44bfe58891
commit 91d15df765

View File

@ -116,8 +116,8 @@ func (m *MQTTForwarder) onServerDisconnect(d *paho.Disconnect) {
logEntry.Msg("mqtt client: server requested disconnect") logEntry.Msg("mqtt client: server requested disconnect")
} }
func (c *MQTTForwarder) Broadcast(topic EventTopic, payload interface{}) { func (m *MQTTForwarder) Broadcast(topic EventTopic, payload interface{}) {
fullTopic := c.topicPrefix + string(topic) fullTopic := m.topicPrefix + string(topic)
logger := log.With(). logger := log.With().
Str("topic", fullTopic). Str("topic", fullTopic).
@ -134,7 +134,7 @@ func (c *MQTTForwarder) Broadcast(topic EventTopic, payload interface{}) {
// Publish will block so we run it in a GoRoutine. // Publish will block so we run it in a GoRoutine.
// TODO: might be a good idea todo this at the event broker level, rather than in this function. // TODO: might be a good idea todo this at the event broker level, rather than in this function.
go func(topic string, msg []byte) { go func(topic string, msg []byte) {
pr, err := c.conn.Publish(c.ctx, &paho.Publish{ pr, err := m.conn.Publish(m.ctx, &paho.Publish{
QoS: mqttQoS, QoS: mqttQoS,
Topic: topic, Topic: topic,
Payload: msg, Payload: msg,