From 25084b928a91599db2515591cfa9a0b318ba6e99 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Tue, 2 Jun 2020 22:24:49 +0100 Subject: [PATCH] Various debug for checks --- src/main.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 401c602..131ca10 100644 --- a/src/main.rs +++ b/src/main.rs @@ -92,15 +92,17 @@ impl MaxHandles { return Handle { parent: self }; } } + debug!("Sleeping for handle"); task::sleep(time::Duration::from_millis(500)).await; + debug!("Awoke from sleeping"); } } } impl<'a> Drop for Handle<'a> { fn drop(&mut self) { - debug!("Dropping"); - self.parent.remaining.fetch_add(1, Ordering::Relaxed); + let remaining = self.parent.remaining.fetch_add(1, Ordering::Relaxed); + debug!("Dropping (remaining {})", remaining); } } @@ -317,7 +319,7 @@ async fn main() -> Result<(), Error> { let mut not_written = 0; let mut last_written = Local::now(); while url_checks.len() > 0 { - debug!("Waiting..."); + debug!("Waiting for {}", url_checks.len()); let ((url, res), _index, remaining) = select_all(url_checks).await; url_checks = remaining; match res {