Skip to content

Commit 5db505e

Browse files
committed
fixup! fix: allow concurrent tedge connect <cloud> --test processes
Signed-off-by: Rina Fujino <[email protected]>
1 parent ce91330 commit 5db505e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

crates/common/mqtt_channel/src/config.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,13 +294,14 @@ impl Config {
294294
}
295295
}
296296

297-
/// Set the random session name with prefix
297+
/// Set the random session name with prefix and clear the session
298298
pub fn with_session_prefix(self, prefix: impl Into<String>) -> Self {
299299
let random: String = std::iter::repeat_with(fastrand::lowercase)
300300
.take(10)
301301
.collect();
302302
Self {
303303
session_name: Some(format!("{}-{}", prefix.into(), random)),
304+
clean_session: true,
304305
..self
305306
}
306307
}

crates/core/tedge/src/cli/connect/c8y.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ pub(crate) async fn check_device_status_c8y(
200200
let mut mqtt_options = tedge_config
201201
.mqtt_config()?
202202
.with_session_prefix(CLIENT_ID)
203-
.with_clean_session(true)
204203
.rumqttc_options()?;
205204

206205
mqtt_options.set_keep_alive(RESPONSE_TIMEOUT);
@@ -324,7 +323,6 @@ pub(crate) async fn get_connected_c8y_url(
324323
let mut mqtt_options = tedge_config
325324
.mqtt_config()?
326325
.with_session_prefix(CLIENT_ID)
327-
.with_clean_session(true)
328326
.rumqttc_options()?;
329327
mqtt_options.set_keep_alive(RESPONSE_TIMEOUT);
330328

0 commit comments

Comments
 (0)