File tree Expand file tree Collapse file tree 2 files changed +2
-3
lines changed
core/tedge/src/cli/connect Expand file tree Collapse file tree 2 files changed +2
-3
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments