mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2024-11-25 16:17:56 +01:00
Sets a 20 second MQTT keepalive intervall
This commit is contained in:
parent
0d2f0a49da
commit
53f871ac49
@ -3,6 +3,7 @@ use std::task::{Poll, Context};
|
|||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::future::Future;
|
use std::future::Future;
|
||||||
|
use std::time::Duration;
|
||||||
|
|
||||||
use futures::{future::BoxFuture, Stream};
|
use futures::{future::BoxFuture, Stream};
|
||||||
use futures::channel::mpsc;
|
use futures::channel::mpsc;
|
||||||
@ -142,7 +143,11 @@ pub fn load(log: &Logger, config: &Config) -> Result<(ActorMap, Vec<Actor>)> {
|
|||||||
let tok = c.reconnect();
|
let tok = c.reconnect();
|
||||||
smol::block_on(tok);
|
smol::block_on(tok);
|
||||||
});
|
});
|
||||||
let tok = mqtt.connect(paho_mqtt::ConnectOptions::new());
|
let conn_opts = paho_mqtt::ConnectOptionsBuilder::new()
|
||||||
|
.keep_alive_interval(Duration::from_secs(20))
|
||||||
|
.clean_session(false)
|
||||||
|
.finalize();
|
||||||
|
let tok = mqtt.connect(conn_opts);
|
||||||
smol::block_on(tok)?;
|
smol::block_on(tok)?;
|
||||||
|
|
||||||
let actuators = config.actors.iter()
|
let actuators = config.actors.iter()
|
||||||
|
Loading…
Reference in New Issue
Block a user