Fix mqtt_consumer connection_timeout test

This commit is contained in:
Daniel Nelson 2017-10-02 12:28:31 -07:00
parent ed6f438c9d
commit cdca81c999
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
1 changed files with 2 additions and 2 deletions

View File

@ -121,8 +121,8 @@ func (m *MQTTConsumer) Start(acc telegraf.Accumulator) error {
return fmt.Errorf("MQTT Consumer, invalid QoS value: %d", m.QoS)
}
if int(m.ConnectionTimeout.Duration) <= 0 {
return fmt.Errorf("MQTT Consumer, invalid connection_timeout value: %d", m.ConnectionTimeout)
if m.ConnectionTimeout.Duration < 1*time.Second {
return fmt.Errorf("MQTT Consumer, invalid connection_timeout value: %s", m.ConnectionTimeout.Duration)
}
opts, err := m.createOpts()