diff --git a/src/fetch.rs b/src/fetch.rs index 5812ab4..74925e0 100644 --- a/src/fetch.rs +++ b/src/fetch.rs @@ -61,8 +61,9 @@ impl PdfFetcher { Err(_) => None, }; + let now = Instant::now(); if let Some(instant) = self.last_checked { - if Instant::now() - instant < *MIN_CHECK_INTERVAL { + if now - instant < *MIN_CHECK_INTERVAL { return if cache_modtime.is_some() { self.cached_pdf() } else { @@ -124,6 +125,7 @@ impl PdfFetcher { + Unpin>::close(&mut sink) .await?; } + self.last_checked = Some(now); self.cached_pdf() }