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 fcd6d4eb09
commit 8c932abff6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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