tokio 1.0: delay -> sleep

almost the same thing, new name(s), no longer Unpin

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler
2020-12-03 16:04:23 +01:00
parent 427d90e6c1
commit 0a8d773ad0
7 changed files with 15 additions and 15 deletions

View File

@ -331,17 +331,17 @@ async fn get_service_state(service: &str) -> Result<String, Error> {
}
async fn wait_service_is_state(service: &str, state: &str) -> Result<(), Error> {
tokio::time::delay_for(std::time::Duration::new(1, 0)).await;
tokio::time::sleep(std::time::Duration::new(1, 0)).await;
while get_service_state(service).await? != state {
tokio::time::delay_for(std::time::Duration::new(5, 0)).await;
tokio::time::sleep(std::time::Duration::new(5, 0)).await;
}
Ok(())
}
async fn wait_service_is_not_state(service: &str, state: &str) -> Result<(), Error> {
tokio::time::delay_for(std::time::Duration::new(1, 0)).await;
tokio::time::sleep(std::time::Duration::new(1, 0)).await;
while get_service_state(service).await? == state {
tokio::time::delay_for(std::time::Duration::new(5, 0)).await;
tokio::time::sleep(std::time::Duration::new(5, 0)).await;
}
Ok(())
}