fix: don't output empty lines without loglevel'
Some checks are pending
Conventional Commits / Conventional Commits (push) Waiting to run

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
This commit is contained in:
Christina Sørensen 2024-09-05 07:48:21 +02:00
parent e56333a708
commit c6fd77bc01
Signed by: cafkafk
GPG key ID: 26C542FD97F965CE

View file

@ -9,8 +9,7 @@ use async_recursion::async_recursion;
use reqwest::Client; use reqwest::Client;
use tokio::time::sleep; use tokio::time::sleep;
#[allow(unused)] use log;
use log::{debug, error, info, trace, warn};
const MAX_SLIDE: u64 = 1000; const MAX_SLIDE: u64 = 1000;
@ -29,8 +28,7 @@ pub async fn nar_exists(client: Client, domain: &str, hash: &str, slide: u64) ->
// //
// Writng an actual sliding window seems kinda hard, // Writng an actual sliding window seems kinda hard,
// so we do this instead. // so we do this instead.
trace!("rate limited! {slide}"); log::trace!("rate limited! {slide}");
println!("");
sleep(Duration::from_millis(slide)).await; sleep(Duration::from_millis(slide)).await;
nar_exists(client, domain, hash, std::cmp::min(slide * 2, MAX_SLIDE)).await nar_exists(client, domain, hash, std::cmp::min(slide * 2, MAX_SLIDE)).await
} }