Skip to content

Commit

Permalink
Add automatic reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
Peyton-McKee committed Feb 29, 2024
1 parent 9ca751b commit a359149
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/mqtt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ impl MqttClient {
.keep_alive_interval(Duration::from_secs(20))
.clean_session(false)
.will_message(lastwilltestatment)
.automatic_reconnect(1, 10)
.finalize();
if let Err(e) = client.connect(conn_opts) {
println!("Unable to connect:\n\t{:?}", e);
Expand Down

0 comments on commit a359149

Please sign in to comment.