Disable keepalive in mqtt output. (#3779)

This functionality currently has race conditions that can result in the
output deadlocking.

(cherry picked from commit 8c932abff6)
This commit is contained in:
Daniel Nelson 2018-02-25 01:04:04 -08:00 committed by Daniel Nelson
parent d8dae1b1ab
commit d8f2d4af0f
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
1 changed files with 1 additions and 0 deletions

View File

@ -162,6 +162,7 @@ func (m *MQTT) publish(topic string, body []byte) error {
func (m *MQTT) createOpts() (*paho.ClientOptions, error) {
opts := paho.NewClientOptions()
opts.KeepAlive = 0 * time.Second
if m.Timeout.Duration < time.Second {
m.Timeout.Duration = 5 * time.Second