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:
@ -41,7 +41,7 @@ pub async fn wait_for_local_worker(upid_str: &str) -> Result<(), Error> {
|
||||
|
||||
loop {
|
||||
if proxmox_backup::server::worker_is_active_local(&upid) {
|
||||
tokio::time::delay_for(sleep_duration).await;
|
||||
tokio::time::sleep(sleep_duration).await;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
@ -262,7 +262,7 @@ async fn run_task_scheduler() {
|
||||
Ok(d) => d,
|
||||
Err(err) => {
|
||||
eprintln!("task scheduler: compute next minute failed - {}", err);
|
||||
tokio::time::delay_until(tokio::time::Instant::from_std(Instant::now() + Duration::from_secs(60))).await;
|
||||
tokio::time::sleep_until(tokio::time::Instant::from_std(Instant::now() + Duration::from_secs(60))).await;
|
||||
continue;
|
||||
}
|
||||
};
|
||||
@ -286,7 +286,7 @@ async fn run_task_scheduler() {
|
||||
}
|
||||
}
|
||||
|
||||
tokio::time::delay_until(tokio::time::Instant::from_std(delay_target)).await;
|
||||
tokio::time::sleep_until(tokio::time::Instant::from_std(delay_target)).await;
|
||||
}
|
||||
}
|
||||
|
||||
@ -649,7 +649,7 @@ async fn run_stat_generator() {
|
||||
|
||||
generate_host_stats(save).await;
|
||||
|
||||
tokio::time::delay_until(tokio::time::Instant::from_std(delay_target)).await;
|
||||
tokio::time::sleep_until(tokio::time::Instant::from_std(delay_target)).await;
|
||||
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ async fn wait_for_local_worker(upid_str: &str) -> Result<(), Error> {
|
||||
if !proxmox_backup::server::worker_is_active_local(&upid) {
|
||||
break;
|
||||
}
|
||||
tokio::time::delay_for(sleep_duration).await;
|
||||
tokio::time::sleep(sleep_duration).await;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ pub async fn wait_for_local_worker(upid_str: &str) -> Result<(), Error> {
|
||||
|
||||
loop {
|
||||
if worker_is_active_local(&upid) {
|
||||
tokio::time::delay_for(sleep_duration).await;
|
||||
tokio::time::sleep(sleep_duration).await;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user