Add missing re-connect config in mqtt connection options.

This commit is contained in:
Orne Brocaar 2022-07-08 13:57:34 +01:00
parent 0d4003a2be
commit 9ecfbab5b5
2 changed files with 4 additions and 0 deletions

View File

@ -1,4 +1,5 @@
use std::io::Cursor;
use std::time::Duration;
use anyhow::{Context, Result};
use async_trait::async_trait;
@ -93,6 +94,7 @@ impl<'a> MqttBackend<'a> {
// connection options
let mut conn_opts_b = mqtt::ConnectOptionsBuilder::new();
conn_opts_b.automatic_reconnect(Duration::from_secs(1), Duration::from_secs(30));
conn_opts_b.clean_session(conf.clean_session);
conn_opts_b.user_name(&conf.username);
conn_opts_b.password(&conf.password);

View File

@ -1,5 +1,6 @@
use std::collections::HashMap;
use std::io::Cursor;
use std::time::Duration;
use anyhow::{Context, Result};
use async_trait::async_trait;
@ -66,6 +67,7 @@ impl<'a> Integration<'a> {
// connection options
let mut conn_opts_b = mqtt::ConnectOptionsBuilder::new();
conn_opts_b.automatic_reconnect(Duration::from_secs(1), Duration::from_secs(30));
conn_opts_b.clean_session(conf.clean_session);
conn_opts_b.user_name(&conf.username);
conn_opts_b.password(&conf.password);