Mqtt: wait for retained messages
This commit is contained in:
parent
d10497f7e2
commit
96ef894ccc
1 changed files with 2 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue