mirror of
https://github.com/FliegendeWurst/KIT-ILIAS-downloader.git
synced 2024-08-28 04:04:18 +00:00
Add missing await
This commit is contained in:
parent
e7354e0ad1
commit
1459ff5ae4
@ -188,7 +188,7 @@ fn process_gracefully(ilias: Arc<ILIAS>, 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);
|
||||
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user