diff --git a/src/main.rs b/src/main.rs index ca7c53b..50aa129 100644 --- a/src/main.rs +++ b/src/main.rs @@ -351,13 +351,10 @@ pub fn main() -> Result<()> { // println!("content: {}",&config_content); let rt = tokio::runtime::Runtime::new().unwrap_or_else(|e| panic!("Error create tokio runtime {}",e) - ); - let webs_rt = tokio::runtime::Runtime::new().unwrap_or_else(|e| - panic!("Error create webs tokio runtime {}",e) ); // let mut web_tasks = Vec::new(); websrvrs.iter().enumerate().for_each(|(pos,it)| { - webs_rt.block_on(async move { + rt.block_on(async move { println!("{} -> {}",it.name,pos); tokio::spawn(async move {up_web_server(pos).await}); tokio::time::sleep(tokio::time::Duration::from_secs(5)).await; @@ -365,7 +362,6 @@ pub fn main() -> Result<()> { }); loop { rt.block_on(async move { - tokio::time::sleep(tokio::time::Duration::from_secs(5)).await; if run_check { tokio::spawn(async {run_check_clouds().await }); // For async task tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;