From 1459ff5ae451c42001a86849a3dbdf586929044d Mon Sep 17 00:00:00 2001 From: FliegendeWurst <2012gdwu+github@posteo.de> Date: Wed, 2 Jun 2021 11:53:50 +0200 Subject: [PATCH] Add missing await --- src/main.rs | 2 +- src/queue.rs | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/main.rs b/src/main.rs index 197e931..ca57d6b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -188,7 +188,7 @@ fn process_gracefully(ilias: Arc, path: PathBuf, obj: Object) -> impl Fut PROGRESS_BAR.inc_length(1); } async move { - let permit = queue::get_ticket(); + let permit = queue::get_ticket().await; let path_text = path.to_string_lossy().into_owned(); if let Err(e) = process(ilias, path, obj).await.context("failed to process URL") { error!("Syncing {}", path_text; e); diff --git a/src/queue.rs b/src/queue.rs index 50cd2ad..de9619a 100644 --- a/src/queue.rs +++ b/src/queue.rs @@ -29,14 +29,6 @@ pub fn set_download_rate(rate: usize) { let mut interval = time::interval(time::Duration::from_secs_f64(60.0 / rate as f64)); loop { interval.tick().await; - log!( - 0, - "interval ticked @ {}", - std::time::SystemTime::now() - .duration_since(std::time::SystemTime::UNIX_EPOCH) - .unwrap() - .as_secs() - ); REQUEST_TICKETS.add_permits(1); } });