From 1c10c516e0937715896bb06f9476a8f86410312b Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 May 2024 22:17:47 +0300 Subject: [PATCH] make agent continue working without access to platform --- src/main.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3dd71c8..333cc88 100644 --- a/src/main.rs +++ b/src/main.rs @@ -97,15 +97,14 @@ async fn main_normal( async move {}.boxed() }) } - let _socket = socket.connect().await.expect("Connection failed"); + let _socket = socket.connect().await?; sleep(Duration::from_secs(10)); loop { info!("me request"); let _res = _socket .emit("me", json!({})) - .await - .expect("Server unreachable"); + .await; sleep(Duration::from_secs(60)); } } @@ -188,11 +187,11 @@ async fn main() -> Result<(), Box> { //} let _ = main_normal(main_args, main_config, main_robots).await; - Ok(()) + - //loop { - // tokio::time::sleep(Duration::from_secs(1)); - //} + loop { + tokio::time::sleep(Duration::from_secs(1)); + } } #[cfg(test)]