mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-02-21 01:21:21 +00:00
Set MQTT persistence to TMP dir instead of CWD.
This commit is contained in:
parent
eee1c4b4b0
commit
10d75a1744
@ -1,4 +1,5 @@
|
||||
use std::collections::hash_map::DefaultHasher;
|
||||
use std::env::temp_dir;
|
||||
use std::hash::Hasher;
|
||||
use std::io::Cursor;
|
||||
use std::time::Duration;
|
||||
@ -109,6 +110,7 @@ impl<'a> MqttBackend<'a> {
|
||||
region_name: region_name.to_string(),
|
||||
region_common_name,
|
||||
}))
|
||||
.persistence(mqtt::create_options::PersistenceType::FilePath(temp_dir()))
|
||||
.finalize();
|
||||
let mut client = mqtt::AsyncClient::new(create_opts).context("Create MQTT client")?;
|
||||
client.set_connected_callback(move |client| {
|
||||
|
@ -1,4 +1,5 @@
|
||||
use std::collections::HashMap;
|
||||
use std::env::temp_dir;
|
||||
use std::io::Cursor;
|
||||
use std::time::Duration;
|
||||
|
||||
@ -81,6 +82,7 @@ impl<'a> Integration<'a> {
|
||||
let create_opts = mqtt::CreateOptionsBuilder::new()
|
||||
.server_uri(&conf.server)
|
||||
.client_id(&client_id)
|
||||
.persistence(mqtt::create_options::PersistenceType::FilePath(temp_dir()))
|
||||
.finalize();
|
||||
let mut client = mqtt::AsyncClient::new(create_opts).context("Create MQTT client")?;
|
||||
client.set_connected_callback(move |_client| {
|
||||
|
Loading…
x
Reference in New Issue
Block a user