MQTT: cleanup deletes at QoS 0, synchronously (#30139)
This commit is contained in:
parent
04b7e076a7
commit
88d0f9c401
1 changed files with 5 additions and 1 deletions
|
|
@ -154,7 +154,11 @@ func (m *Client) Cleanup(topic string, retained bool) error {
|
|||
}
|
||||
|
||||
m.log.TRACE.Printf("delete: %s", msg.Topic())
|
||||
m.Publish(msg.Topic(), true, "")
|
||||
// Delete synchronously at QoS 0 so the cleanup burst self-throttles
|
||||
// to one in-flight message at a time and avoids overwhelming the
|
||||
// broker (see #30086).
|
||||
token := m.client.Publish(msg.Topic(), 0, true, "")
|
||||
token.WaitTimeout(request.Timeout)
|
||||
|
||||
// reset timeout
|
||||
timer.Reset(time.Second)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue