From 65a3217b04b1eef822a9fcb2d8afc1695fb7a9fc Mon Sep 17 00:00:00 2001 From: Lukasz Woznicki <75632179+makr11st@users.noreply.github.com> Date: Fri, 10 Dec 2021 14:26:59 +0000 Subject: [PATCH] A quick workaround for the issue: use the same wait for mosquitto as on first restart. WIP on proper pub/sub check (#707) Signed-off-by: Lukasz Woznicki Co-authored-by: Rina Fujino <18257209+rina23q@users.noreply.github.com> --- crates/core/tedge/src/cli/connect/command.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/core/tedge/src/cli/connect/command.rs b/crates/core/tedge/src/cli/connect/command.rs index 46419f08779..fb2f9d17392 100644 --- a/crates/core/tedge/src/cli/connect/command.rs +++ b/crates/core/tedge/src/cli/connect/command.rs @@ -131,6 +131,14 @@ impl Command for ConnectCommand { self.service_manager.as_ref(), &self.config_location, )?; + + println!( + "Awaiting mosquitto to start. This may take up to {} seconds.\n", + MOSQUITTO_RESTART_TIMEOUT_SECONDS + ); + std::thread::sleep(std::time::Duration::from_secs( + MOSQUITTO_RESTART_TIMEOUT_SECONDS, + )); } } Err(_) => {