Fix mqtt_consumer connection_timeout test
This commit is contained in:
parent
fcfa7ed7bf
commit
63e898c058
|
@ -121,8 +121,8 @@ func (m *MQTTConsumer) Start(acc telegraf.Accumulator) error {
|
||||||
return fmt.Errorf("MQTT Consumer, invalid QoS value: %d", m.QoS)
|
return fmt.Errorf("MQTT Consumer, invalid QoS value: %d", m.QoS)
|
||||||
}
|
}
|
||||||
|
|
||||||
if int(m.ConnectionTimeout.Duration) <= 0 {
|
if m.ConnectionTimeout.Duration < 1*time.Second {
|
||||||
return fmt.Errorf("MQTT Consumer, invalid connection_timeout value: %d", m.ConnectionTimeout)
|
return fmt.Errorf("MQTT Consumer, invalid connection_timeout value: %s", m.ConnectionTimeout.Duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
opts, err := m.createOpts()
|
opts, err := m.createOpts()
|
||||||
|
|
Loading…
Reference in New Issue