Disable keepalive in mqtt output. (#3779)

This functionality currently has race conditions that can result in the
output deadlocking.
This commit is contained in:
Daniel Nelson 2018-02-25 01:04:04 -08:00 committed by GitHub
parent 7648a2a5c5
commit 3c179494ce
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) { func (m *MQTT) createOpts() (*paho.ClientOptions, error) {
opts := paho.NewClientOptions() opts := paho.NewClientOptions()
opts.KeepAlive = 0 * time.Second
if m.Timeout.Duration < time.Second { if m.Timeout.Duration < time.Second {
m.Timeout.Duration = 5 * time.Second m.Timeout.Duration = 5 * time.Second