From 50a25c494a3a521ac9ed0e619aa60b2ec9336c46 Mon Sep 17 00:00:00 2001 From: xenofem Date: Tue, 5 Apr 2022 18:50:55 -0400 Subject: [PATCH] actually update last_checked --- src/fetch.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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() }