Disable keepalive in mqtt output. (#3779)
This functionality currently has race conditions that can result in the output deadlocking.
This commit is contained in:
parent
7648a2a5c5
commit
3c179494ce
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue