Skip to content

Commit

Permalink
retain map/calibration messages when sending to MQTT
Browse files Browse the repository at this point in the history
  • Loading branch information
erkexzcx committed Nov 2, 2023
1 parent c3cfa2f commit 81aeb12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/mqtt/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func startProducer(c *config.MQTTConfig, renderedMapChan, calibrationDataChan ch

func producerMapUpdatesHandler(client mqttgo.Client, renderedMapChan chan []byte, topic string) {
for img := range renderedMapChan {
token := client.Publish(topic, 1, false, img)
token := client.Publish(topic, 1, true, img)
token.Wait()
if token.Error() != nil {
log.Printf("[MQTT producer] Failed to publish: %v\n", token.Error())
Expand Down Expand Up @@ -108,7 +108,7 @@ func produceAnnounceMapTopic(client mqttgo.Client, rmt string, c *config.MQTTCon

func producerCalibrationDataHandler(client mqttgo.Client, renderedMapChan chan []byte, topic string) {
for img := range renderedMapChan {
token := client.Publish(topic, 1, false, img)
token := client.Publish(topic, 1, true, img)
token.Wait()
if token.Error() != nil {
log.Printf("[MQTT producer] Failed to publish: %v\n", token.Error())
Expand Down

0 comments on commit 81aeb12

Please sign in to comment.