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 committed 2021-01-14 16:01:33 +01:00
1 parent 427d90e6c1
commit 0a8d773ad0
7 files changed
+15 -15

No files matched your search

+4 -4
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(())
}