Skip to content

Commit

Permalink
Mqtt: wait for retained messages
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Dec 23, 2023
1 parent d10497f commit 96ef894
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions provider/mqtt/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ func (m *Client) Listen(topic string, callback func(string)) error {
case <-time.After(request.Timeout):
return fmt.Errorf("subscribe: %s: %w", topic, api.ErrTimeout)
case <-token.Done():
// TODO depends on https://github.com/eclipse/paho.mqtt.golang/issues/663
time.Sleep(100 * time.Millisecond)
return nil
}
}
Expand Down

0 comments on commit 96ef894

Please sign in to comment.